diff --git a/src/cli/DeepInfra.CLI/Commands/AccountAccountEmailValuesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountAccountEmailValuesCommandApiCommand.g.cs new file mode 100644 index 00000000..f11f499b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountAccountEmailValuesCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountAccountEmailValuesCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.EmailsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.EmailsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"email-values", @"Account Email Values"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.AccountEmailValuesAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Emails", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountAccountGpuPoolCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountAccountGpuPoolCommandApiCommand.g.cs new file mode 100644 index 00000000..dfe7ab07 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountAccountGpuPoolCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountAccountGpuPoolCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.GpuPoolOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.GpuPoolOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"gpu-pool", @"Account Gpu Pool"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.AccountGpuPoolAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountAccountRateLimitCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountAccountRateLimitCommandApiCommand.g.cs new file mode 100644 index 00000000..f5b8827a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountAccountRateLimitCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountAccountRateLimitCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RateLimitOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RateLimitOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"rate-limit", @"Account Rate Limit"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.AccountRateLimitAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountAccountUpdateDetailsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountAccountUpdateDetailsCommandApiCommand.g.cs new file mode 100644 index 00000000..a60f3973 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountAccountUpdateDetailsCommandApiCommand.g.cs @@ -0,0 +1,230 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountAccountUpdateDetailsCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option NameOption { get; } = new( + name: @"--name") + { + Description = @"Personal name", + }; + + private static Option FirstName { get; } = new( + name: @"--first-name") + { + Description = @"First name of the user", + }; + + private static Option LastName { get; } = new( + name: @"--last-name") + { + Description = @"Last name of the user", + }; + + private static Option Country { get; } = new( + name: @"--country") + { + Description = @"Country of the user", + }; + + private static Option Email { get; } = new( + name: @"--email") + { + Description = @"", + }; + + private static Option IsBusinessAccount { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--is-business-account", + description: @""); + + private static Option Company { get; } = new( + name: @"--company") + { + Description = @"Company name", + }; + + private static Option Website { get; } = new( + name: @"--website") + { + Description = @"Company website address", + }; + + private static Option Title { get; } = new( + name: @"--title") + { + Description = @"Job title of the user, e.g. 'Software Engineer'", + }; + + private static Option DisplayName { get; } = new( + name: @"--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.", + }; + + private static Option UseCase { get; } = new( + name: @"--use-case") + { + Description = @"Short description of the use case for the account", + }; + + private static Option Attribution { get; } = new( + name: @"--attribution") + { + Description = @"Short description of how the user found out about DeepInfra", + }; + + private static Option MarketingEmails { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--marketing-emails", + description: @"Set to false to opt out of marketing emails"); + + private static Option CountryCode { get; } = new( + name: @"--country-code") + { + Description = @"ISO 3166-1 alpha-2 country code of the user selected country", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-details", @"Account Update Details"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(NameOption); + command.Options.Add(FirstName); + command.Options.Add(LastName); + command.Options.Add(Country); + command.Options.Add(Email); + command.Options.Add(IsBusinessAccount); + command.Options.Add(Company); + command.Options.Add(Website); + command.Options.Add(Title); + command.Options.Add(DisplayName); + command.Options.Add(UseCase); + command.Options.Add(Attribution); + command.Options.Add(MarketingEmails); + command.Options.Add(CountryCode); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var name = CliRuntime.WasSpecified(parseResult, NameOption) ? parseResult.GetValue(NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var firstName = CliRuntime.WasSpecified(parseResult, FirstName) ? parseResult.GetValue(FirstName) : (__requestBase is { } __FirstNameBaseValue ? __FirstNameBaseValue.FirstName : default); + var lastName = CliRuntime.WasSpecified(parseResult, LastName) ? parseResult.GetValue(LastName) : (__requestBase is { } __LastNameBaseValue ? __LastNameBaseValue.LastName : default); + var country = CliRuntime.WasSpecified(parseResult, Country) ? parseResult.GetValue(Country) : (__requestBase is { } __CountryBaseValue ? __CountryBaseValue.Country : default); + var email = CliRuntime.WasSpecified(parseResult, Email) ? parseResult.GetValue(Email) : (__requestBase is { } __EmailBaseValue ? __EmailBaseValue.Email : default); + var isBusinessAccount = CliRuntime.WasSpecified(parseResult, IsBusinessAccount) ? parseResult.GetValue(IsBusinessAccount) : (__requestBase is { } __IsBusinessAccountBaseValue ? __IsBusinessAccountBaseValue.IsBusinessAccount : default); + var company = CliRuntime.WasSpecified(parseResult, Company) ? parseResult.GetValue(Company) : (__requestBase is { } __CompanyBaseValue ? __CompanyBaseValue.Company : default); + var website = CliRuntime.WasSpecified(parseResult, Website) ? parseResult.GetValue(Website) : (__requestBase is { } __WebsiteBaseValue ? __WebsiteBaseValue.Website : default); + var title = CliRuntime.WasSpecified(parseResult, Title) ? parseResult.GetValue(Title) : (__requestBase is { } __TitleBaseValue ? __TitleBaseValue.Title : default); + var displayName = CliRuntime.WasSpecified(parseResult, DisplayName) ? parseResult.GetValue(DisplayName) : (__requestBase is { } __DisplayNameBaseValue ? __DisplayNameBaseValue.DisplayName : default); + var useCase = CliRuntime.WasSpecified(parseResult, UseCase) ? parseResult.GetValue(UseCase) : (__requestBase is { } __UseCaseBaseValue ? __UseCaseBaseValue.UseCase : default); + var attribution = CliRuntime.WasSpecified(parseResult, Attribution) ? parseResult.GetValue(Attribution) : (__requestBase is { } __AttributionBaseValue ? __AttributionBaseValue.Attribution : default); + var marketingEmails = CliRuntime.WasSpecified(parseResult, MarketingEmails) ? parseResult.GetValue(MarketingEmails) : (__requestBase is { } __MarketingEmailsBaseValue ? __MarketingEmailsBaseValue.MarketingEmails : default); + var countryCode = CliRuntime.WasSpecified(parseResult, CountryCode) ? parseResult.GetValue(CountryCode) : (__requestBase is { } __CountryCodeBaseValue ? __CountryCodeBaseValue.CountryCode : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.AccountUpdateDetailsAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountApiGroupCommand.g.cs new file mode 100644 index 00000000..a707330b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountApiGroupCommand.g.cs @@ -0,0 +1,24 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class AccountApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"account", @"Account endpoint commands."); + command.Subcommands.Add(AccountAccountEmailValuesCommandApiCommand.Create()); + command.Subcommands.Add(AccountAccountGpuPoolCommandApiCommand.Create()); + command.Subcommands.Add(AccountAccountRateLimitCommandApiCommand.Create()); + command.Subcommands.Add(AccountAccountUpdateDetailsCommandApiCommand.Create()); + command.Subcommands.Add(AccountDeleteAccountCommandApiCommand.Create()); + command.Subcommands.Add(AccountGpuPoolGpuTypesCommandApiCommand.Create()); + command.Subcommands.Add(AccountMeCommandApiCommand.Create()); + command.Subcommands.Add(AccountRequestGpuPoolChangeCommandApiCommand.Create()); + command.Subcommands.Add(AccountRequestRateLimitIncreaseCommandApiCommand.Create()); + command.Subcommands.Add(AccountTeamSetDisplayNameCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountDeleteAccountCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountDeleteAccountCommandApiCommand.g.cs new file mode 100644 index 00000000..9990471e --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountDeleteAccountCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountDeleteAccountCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Me value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Me value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-account", @"Delete Account"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.DeleteAccountAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountEmailValuesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountEmailValuesCommandApiCommand.g.cs deleted file mode 100644 index 16f6eed5..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AccountEmailValuesCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AccountEmailValuesCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.EmailsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.EmailsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"account-email-values", @"Account Email Values"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AccountEmailValuesAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Emails", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountGpuLimitCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountGpuLimitCommandApiCommand.g.cs deleted file mode 100644 index 534f2226..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AccountGpuLimitCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AccountGpuLimitCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.GpuLimitOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.GpuLimitOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"account-gpu-limit", @"Account Gpu Limit"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AccountGpuLimitAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountGpuPoolGpuTypesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountGpuPoolGpuTypesCommandApiCommand.g.cs new file mode 100644 index 00000000..532dc344 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountGpuPoolGpuTypesCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountGpuPoolGpuTypesCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.GpuTypesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.GpuTypesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"gpu-pool-gpu-types", @"Gpu Pool Gpu Types"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.GpuPoolGpuTypesAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"GpuTypes", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountMeCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountMeCommandApiCommand.g.cs new file mode 100644 index 00000000..c3673859 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountMeCommandApiCommand.g.cs @@ -0,0 +1,79 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountMeCommandApiCommand +{ + private static Option Checklist { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--checklist", + description: @""); + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Me value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Me value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"me", @"Me"); + command.Options.Add(Checklist); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var checklist = parseResult.GetValue(Checklist); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.MeAsync( + checklist: checklist, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountRateLimitCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountRateLimitCommandApiCommand.g.cs deleted file mode 100644 index e645c188..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AccountRateLimitCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AccountRateLimitCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RateLimitOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RateLimitOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"account-rate-limit", @"Account Rate Limit"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AccountRateLimitAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountRequestGpuPoolChangeCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountRequestGpuPoolChangeCommandApiCommand.g.cs new file mode 100644 index 00000000..89a0ba9b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountRequestGpuPoolChangeCommandApiCommand.g.cs @@ -0,0 +1,136 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountRequestGpuPoolChangeCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Reason { get; } = new( + name: @"--reason") + { + Description = @"", + Required = true, + }; + + private static Option?> RequestedMin { get; } = new( + name: @"--requested-min") + { + Description = @"", + }; + + private static Option?> RequestedMax { get; } = new( + name: @"--requested-max") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"request-gpu-pool-change", @"Request Gpu Pool Change"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Reason); + command.Options.Add(RequestedMin); + command.Options.Add(RequestedMax); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var reason = parseResult.GetRequiredValue(Reason); + var requestedMin = CliRuntime.WasSpecified(parseResult, RequestedMin) ? parseResult.GetValue(RequestedMin) : (__requestBase is { } __RequestedMinBaseValue ? __RequestedMinBaseValue.RequestedMin : default); + var requestedMax = CliRuntime.WasSpecified(parseResult, RequestedMax) ? parseResult.GetValue(RequestedMax) : (__requestBase is { } __RequestedMaxBaseValue ? __RequestedMaxBaseValue.RequestedMax : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.RequestGpuPoolChangeAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + reason: reason, + requestedMin: requestedMin, + requestedMax: requestedMax, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountRequestRateLimitIncreaseCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountRequestRateLimitIncreaseCommandApiCommand.g.cs new file mode 100644 index 00000000..817cfda5 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountRequestRateLimitIncreaseCommandApiCommand.g.cs @@ -0,0 +1,137 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountRequestRateLimitIncreaseCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option RateLimit { get; } = new( + name: @"--rate-limit") + { + Description = @"", + Required = true, + }; + + private static Option TpmRateLimit { get; } = new( + name: @"--tpm-rate-limit") + { + Description = @"", + }; + + private static Option Reason { get; } = new( + name: @"--reason") + { + Description = @"", + Required = true, + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"request-rate-limit-increase", @"Request Rate Limit Increase"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(RateLimit); + command.Options.Add(TpmRateLimit); + command.Options.Add(Reason); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var rateLimit = parseResult.GetRequiredValue(RateLimit); + var tpmRateLimit = CliRuntime.WasSpecified(parseResult, TpmRateLimit) ? parseResult.GetValue(TpmRateLimit) : (__requestBase is { } __TpmRateLimitBaseValue ? __TpmRateLimitBaseValue.TpmRateLimit : default); + var reason = parseResult.GetRequiredValue(Reason); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.RequestRateLimitIncreaseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + rateLimit: rateLimit, + tpmRateLimit: tpmRateLimit, + reason: reason, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountTeamSetDisplayNameCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountTeamSetDisplayNameCommandApiCommand.g.cs new file mode 100644 index 00000000..c111a408 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountTeamSetDisplayNameCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountTeamSetDisplayNameCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option DisplayName { get; } = new( + name: @"--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.", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"team-set-display-name", @"Team Set Display Name"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(DisplayName); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var displayName = parseResult.GetRequiredValue(DisplayName); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Account.TeamSetDisplayNameAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + displayName: displayName, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AccountUpdateDetailsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountUpdateDetailsCommandApiCommand.g.cs deleted file mode 100644 index 68fab48c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AccountUpdateDetailsCommandApiCommand.g.cs +++ /dev/null @@ -1,205 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AccountUpdateDetailsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option NameOption { get; } = new( - name: @"--name") - { - Description = @"Personal name", - }; - - private static Option FirstName { get; } = new( - name: @"--first-name") - { - Description = @"First name of the user", - }; - - private static Option LastName { get; } = new( - name: @"--last-name") - { - Description = @"Last name of the user", - }; - - private static Option Country { get; } = new( - name: @"--country") - { - Description = @"Country of the user", - }; - - private static Option Email { get; } = new( - name: @"--email") - { - Description = @"", - }; - - private static Option IsBusinessAccount { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--is-business-account", - description: @""); - - private static Option Company { get; } = new( - name: @"--company") - { - Description = @"Company name", - }; - - private static Option Website { get; } = new( - name: @"--website") - { - Description = @"Company website address", - }; - - private static Option Title { get; } = new( - name: @"--title") - { - Description = @"Job title of the user, e.g. 'Software Engineer'", - }; - - private static Option DisplayName { get; } = new( - name: @"--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.", - }; - - private static Option UseCase { get; } = new( - name: @"--use-case") - { - Description = @"Short description of the use case for the account", - }; - - private static Option Attribution { get; } = new( - name: @"--attribution") - { - Description = @"Short description of how the user found out about DeepInfra", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"account-update-details", @"Account Update Details"); - command.Options.Add(XiApiKey); - command.Options.Add(NameOption); - command.Options.Add(FirstName); - command.Options.Add(LastName); - command.Options.Add(Country); - command.Options.Add(Email); - command.Options.Add(IsBusinessAccount); - command.Options.Add(Company); - command.Options.Add(Website); - command.Options.Add(Title); - command.Options.Add(DisplayName); - command.Options.Add(UseCase); - command.Options.Add(Attribution); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var name = CliRuntime.WasSpecified(parseResult, NameOption) ? parseResult.GetValue(NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); - var firstName = CliRuntime.WasSpecified(parseResult, FirstName) ? parseResult.GetValue(FirstName) : (__requestBase is { } __FirstNameBaseValue ? __FirstNameBaseValue.FirstName : default); - var lastName = CliRuntime.WasSpecified(parseResult, LastName) ? parseResult.GetValue(LastName) : (__requestBase is { } __LastNameBaseValue ? __LastNameBaseValue.LastName : default); - var country = CliRuntime.WasSpecified(parseResult, Country) ? parseResult.GetValue(Country) : (__requestBase is { } __CountryBaseValue ? __CountryBaseValue.Country : default); - var email = CliRuntime.WasSpecified(parseResult, Email) ? parseResult.GetValue(Email) : (__requestBase is { } __EmailBaseValue ? __EmailBaseValue.Email : default); - var isBusinessAccount = CliRuntime.WasSpecified(parseResult, IsBusinessAccount) ? parseResult.GetValue(IsBusinessAccount) : (__requestBase is { } __IsBusinessAccountBaseValue ? __IsBusinessAccountBaseValue.IsBusinessAccount : default); - var company = CliRuntime.WasSpecified(parseResult, Company) ? parseResult.GetValue(Company) : (__requestBase is { } __CompanyBaseValue ? __CompanyBaseValue.Company : default); - var website = CliRuntime.WasSpecified(parseResult, Website) ? parseResult.GetValue(Website) : (__requestBase is { } __WebsiteBaseValue ? __WebsiteBaseValue.Website : default); - var title = CliRuntime.WasSpecified(parseResult, Title) ? parseResult.GetValue(Title) : (__requestBase is { } __TitleBaseValue ? __TitleBaseValue.Title : default); - var displayName = CliRuntime.WasSpecified(parseResult, DisplayName) ? parseResult.GetValue(DisplayName) : (__requestBase is { } __DisplayNameBaseValue ? __DisplayNameBaseValue.DisplayName : default); - var useCase = CliRuntime.WasSpecified(parseResult, UseCase) ? parseResult.GetValue(UseCase) : (__requestBase is { } __UseCaseBaseValue ? __UseCaseBaseValue.UseCase : default); - var attribution = CliRuntime.WasSpecified(parseResult, Attribution) ? parseResult.GetValue(Attribution) : (__requestBase is { } __AttributionBaseValue ? __AttributionBaseValue.Attribution : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AccountUpdateDetailsAsync( - xiApiKey: xiApiKey, - name: name, - firstName: firstName, - lastName: lastName, - country: country, - email: email, - isBusinessAccount: isBusinessAccount, - company: company, - website: website, - title: title, - displayName: displayName, - useCase: useCase, - attribution: attribution, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AddFundsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AddFundsCommandApiCommand.g.cs deleted file mode 100644 index 6d455b20..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AddFundsCommandApiCommand.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AddFundsCommandApiCommand -{ - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static Option Amount { get; } = new( - name: @"--amount") - { - Description = @"Amount to add in cents", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"add-funds", @"Add Funds"); - command.Options.Add(Session); - command.Options.Add(Amount); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var session = parseResult.GetValue(Session); - var amount = parseResult.GetRequiredValue(Amount); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AddFundsAsync( - session: session, - amount: amount, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsApiGroupCommand.g.cs new file mode 100644 index 00000000..a9dd5af8 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsApiGroupCommand.g.cs @@ -0,0 +1,27 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class AgentsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"agents", @"Agents endpoint commands."); + command.Subcommands.Add(AgentsCreateBackupCommandApiCommand.Create()); + command.Subcommands.Add(AgentsCreateDashboardLaunchTokenCommandApiCommand.Create()); + command.Subcommands.Add(AgentsCreateInstanceCommandApiCommand.Create()); + command.Subcommands.Add(AgentsDeleteInstanceCommandApiCommand.Create()); + command.Subcommands.Add(AgentsGetCatalogCommandApiCommand.Create()); + command.Subcommands.Add(AgentsGetInstanceCommandApiCommand.Create()); + command.Subcommands.Add(AgentsListBackupsCommandApiCommand.Create()); + command.Subcommands.Add(AgentsListInstancesCommandApiCommand.Create()); + command.Subcommands.Add(AgentsRenameInstanceCommandApiCommand.Create()); + command.Subcommands.Add(AgentsRestoreBackupCommandApiCommand.Create()); + command.Subcommands.Add(AgentsStartInstanceCommandApiCommand.Create()); + command.Subcommands.Add(AgentsStopInstanceCommandApiCommand.Create()); + command.Subcommands.Add(AgentsUpdateInstanceVersionCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsCreateBackupCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsCreateBackupCommandApiCommand.g.cs new file mode 100644 index 00000000..996011aa --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsCreateBackupCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsCreateBackupCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-backup", @"Create Backup"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.CreateBackupAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsCreateDashboardLaunchTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsCreateDashboardLaunchTokenCommandApiCommand.g.cs new file mode 100644 index 00000000..bc906245 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsCreateDashboardLaunchTokenCommandApiCommand.g.cs @@ -0,0 +1,93 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsCreateDashboardLaunchTokenCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenClawLaunchTokenOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenClawLaunchTokenOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-dashboard-launch-token", @"Create Dashboard 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)."); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.CreateDashboardLaunchTokenAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsCreateInstanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsCreateInstanceCommandApiCommand.g.cs new file mode 100644 index 00000000..d4874071 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsCreateInstanceCommandApiCommand.g.cs @@ -0,0 +1,135 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsCreateInstanceCommandApiCommand +{ + private static Argument NameOption { get; } = new( + name: @"name") + { + Description = @"Instance name", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option AgentTypeId { get; } = new( + name: @"--agent-type-id") + { + Description = @"Agent type identifier", + }; + + private static Option PlanId { get; } = new( + name: @"--plan-id") + { + Description = @"Plan identifier", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.AgentCreateOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.AgentCreateOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-instance", @"Create Instance"); + command.Arguments.Add(NameOption); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(AgentTypeId); + command.Options.Add(PlanId); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var name = parseResult.GetRequiredValue(NameOption); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var agentTypeId = CliRuntime.WasSpecified(parseResult, AgentTypeId) ? parseResult.GetValue(AgentTypeId) : (__requestBase is { } __AgentTypeIdBaseValue ? __AgentTypeIdBaseValue.AgentTypeId : default); + var planId = CliRuntime.WasSpecified(parseResult, PlanId) ? parseResult.GetValue(PlanId) : (__requestBase is { } __PlanIdBaseValue ? __PlanIdBaseValue.PlanId : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.CreateInstanceAsync( + name: name, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + agentTypeId: agentTypeId, + planId: planId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsDeleteInstanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsDeleteInstanceCommandApiCommand.g.cs new file mode 100644 index 00000000..81e1f125 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsDeleteInstanceCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsDeleteInstanceCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-instance", @"Delete Instance"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.DeleteInstanceAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsGetCatalogCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsGetCatalogCommandApiCommand.g.cs new file mode 100644 index 00000000..395be394 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsGetCatalogCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsGetCatalogCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.Dictionary value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.Dictionary value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-catalog", @"Get Catalog"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.GetCatalogAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsGetInstanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsGetInstanceCommandApiCommand.g.cs new file mode 100644 index 00000000..e6c75c48 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsGetInstanceCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsGetInstanceCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.AgentInstanceOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.AgentInstanceOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-instance", @"Get Instance"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.GetInstanceAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsListBackupsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsListBackupsCommandApiCommand.g.cs new file mode 100644 index 00000000..ed3ddf36 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsListBackupsCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsListBackupsCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list-backups", @"List Backups"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.ListBackupsAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsListInstancesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsListInstancesCommandApiCommand.g.cs new file mode 100644 index 00000000..cfa5f8f2 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsListInstancesCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsListInstancesCommandApiCommand +{ + private static Option State { get; } = new( + name: @"--state") + { + Description = @"Which instances to return: active, inactive, or all (both)", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list-instances", @"List Instances"); + command.Options.Add(State); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var state = parseResult.GetValue(State); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.ListInstancesAsync( + state: state, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsRenameInstanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsRenameInstanceCommandApiCommand.g.cs new file mode 100644 index 00000000..35b5db04 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsRenameInstanceCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsRenameInstanceCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option NameOption { get; } = new( + name: @"--name") + { + Description = @"Instance name", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"rename-instance", @"Rename Instance"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(NameOption); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var name = parseResult.GetRequiredValue(NameOption); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.RenameInstanceAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + name: name, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsRestoreBackupCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsRestoreBackupCommandApiCommand.g.cs new file mode 100644 index 00000000..ccc2980b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsRestoreBackupCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsRestoreBackupCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Argument BackupId { get; } = new( + name: @"backup-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"restore-backup", @"Restore Backup"); + command.Arguments.Add(InstanceId); + command.Arguments.Add(BackupId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var backupId = parseResult.GetRequiredValue(BackupId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.RestoreBackupAsync( + instanceId: instanceId, + backupId: backupId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsStartInstanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsStartInstanceCommandApiCommand.g.cs new file mode 100644 index 00000000..564386f9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsStartInstanceCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsStartInstanceCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"start-instance", @"Start Instance"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.StartInstanceAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsStopInstanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsStopInstanceCommandApiCommand.g.cs new file mode 100644 index 00000000..06c12a50 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsStopInstanceCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsStopInstanceCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"stop-instance", @"Stop Instance"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.StopInstanceAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsUpdateInstanceVersionCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsUpdateInstanceVersionCommandApiCommand.g.cs new file mode 100644 index 00000000..bb7b4e70 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsUpdateInstanceVersionCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsUpdateInstanceVersionCommandApiCommand +{ + private static Argument InstanceId { get; } = new( + name: @"instance-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-instance-version", @"Update Instance Version"); + command.Arguments.Add(InstanceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var instanceId = parseResult.GetRequiredValue(InstanceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Agents.UpdateInstanceVersionAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AnthropicMessagesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AnthropicMessagesCommandApiCommand.g.cs deleted file mode 100644 index 83c76a2b..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AnthropicMessagesCommandApiCommand.g.cs +++ /dev/null @@ -1,247 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AnthropicMessagesCommandApiCommand -{ - private static Option XApiKey { get; } = new( - name: @"--x-api-key") - { - Description = @"", - }; - - private static Option AnthropicVersion { get; } = new( - name: @"--anthropic-version") - { - Description = @"", - }; - - private static Option AnthropicBeta { get; } = new( - name: @"--anthropic-beta") - { - Description = @"", - }; - - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - - private static Option MaxTokens { get; } = new( - name: @"--max-tokens") - { - Description = @"", - }; - - private static Option> Messages { get; } = new( - name: @"--messages") - { - Description = @"", - Required = true, - }; - - private static Option, object>?> System { get; } = new( - name: @"--system") - { - Description = @"", - }; - - private static Option?> StopSequences { get; } = new( - name: @"--stop-sequences") - { - Description = @"", - }; - - private static Option Stream { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--stream", - description: @""); - - private static Option Temperature { get; } = new( - name: @"--temperature") - { - Description = @"", - }; - - private static Option TopP { get; } = new( - name: @"--top-p") - { - Description = @"", - }; - - private static Option TopK { get; } = new( - name: @"--top-k") - { - Description = @"", - }; - - private static Option Metadata { get; } = new( - name: @"--metadata") - { - Description = @"", - }; - - private static Option?> Tools { get; } = new( - name: @"--tools") - { - Description = @"", - }; - - private static Option ToolChoice { get; } = new( - name: @"--tool-choice") - { - Description = @"", - }; - private static readonly AnthropicThinkingConfigOptionSet ThinkingOptions = AnthropicThinkingConfigOptionSet.Create(@"thinking"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"anthropic-messages", @"Anthropic Messages"); - command.Options.Add(XApiKey); - command.Options.Add(AnthropicVersion); - command.Options.Add(AnthropicBeta); - command.Options.Add(XDeepinfraSource); - command.Options.Add(Model); - command.Options.Add(MaxTokens); - command.Options.Add(Messages); - command.Options.Add(System); - command.Options.Add(StopSequences); - command.Options.Add(Stream); - command.Options.Add(Temperature); - command.Options.Add(TopP); - command.Options.Add(TopK); - command.Options.Add(Metadata); - command.Options.Add(Tools); - command.Options.Add(ToolChoice); command.Options.Add(ThinkingOptions.Enabled); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xApiKey = parseResult.GetValue(XApiKey); - var anthropicVersion = parseResult.GetValue(AnthropicVersion); - var anthropicBeta = parseResult.GetValue(AnthropicBeta); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var model = parseResult.GetRequiredValue(Model); - var maxTokens = CliRuntime.WasSpecified(parseResult, MaxTokens) ? parseResult.GetValue(MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); - var messages = parseResult.GetRequiredValue(Messages); - var system = CliRuntime.WasSpecified(parseResult, System) ? parseResult.GetValue(System) : (__requestBase is { } __SystemBaseValue ? __SystemBaseValue.System : default); - var stopSequences = CliRuntime.WasSpecified(parseResult, StopSequences) ? parseResult.GetValue(StopSequences) : (__requestBase is { } __StopSequencesBaseValue ? __StopSequencesBaseValue.StopSequences : default); - var stream = CliRuntime.WasSpecified(parseResult, Stream) ? parseResult.GetValue(Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); - var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var topP = CliRuntime.WasSpecified(parseResult, TopP) ? parseResult.GetValue(TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); - var topK = CliRuntime.WasSpecified(parseResult, TopK) ? parseResult.GetValue(TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); - var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default); - var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); - var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); - - var __ThinkingBase = __requestBase is { } __ThinkingBaseValue ? __ThinkingBaseValue.Thinking : default; var thinkingEnabled = CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled) ? parseResult.GetValue(ThinkingOptions.Enabled) : (__ThinkingBase is { } __ThinkingenabledBaseValue ? __ThinkingenabledBaseValue.Enabled : default); - var __ThinkingSpecified = CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled); - var thinking = - __ThinkingSpecified || __ThinkingBase is not null - ? new global::DeepInfra.AnthropicThinkingConfig - { - Enabled = thinkingEnabled, - - } - : __ThinkingBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AnthropicMessagesAsync( - xApiKey: xApiKey, - anthropicVersion: anthropicVersion, - anthropicBeta: anthropicBeta, - xDeepinfraSource: xDeepinfraSource, - 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, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AnthropicMessagesCountTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AnthropicMessagesCountTokensCommandApiCommand.g.cs deleted file mode 100644 index 2382072b..00000000 --- a/src/cli/DeepInfra.CLI/Commands/AnthropicMessagesCountTokensCommandApiCommand.g.cs +++ /dev/null @@ -1,159 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class AnthropicMessagesCountTokensCommandApiCommand -{ - private static Option XApiKey { get; } = new( - name: @"--x-api-key") - { - Description = @"", - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - - private static Option> Messages { get; } = new( - name: @"--messages") - { - Description = @"", - Required = true, - }; - - private static Option, object>?> System { get; } = new( - name: @"--system") - { - Description = @"", - }; - - private static Option?> Tools { get; } = new( - name: @"--tools") - { - Description = @"", - }; - - private static Option ToolChoice { get; } = new( - name: @"--tool-choice") - { - Description = @"", - }; - private static readonly AnthropicThinkingConfigOptionSet ThinkingOptions = AnthropicThinkingConfigOptionSet.Create(@"thinking"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"anthropic-messages-count-tokens", @"Anthropic Messages Count Tokens"); - command.Options.Add(XApiKey); - command.Options.Add(Model); - command.Options.Add(Messages); - command.Options.Add(System); - command.Options.Add(Tools); - command.Options.Add(ToolChoice); command.Options.Add(ThinkingOptions.Enabled); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xApiKey = parseResult.GetValue(XApiKey); - var model = parseResult.GetRequiredValue(Model); - var messages = parseResult.GetRequiredValue(Messages); - var system = CliRuntime.WasSpecified(parseResult, System) ? parseResult.GetValue(System) : (__requestBase is { } __SystemBaseValue ? __SystemBaseValue.System : default); - var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); - var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); - - var __ThinkingBase = __requestBase is { } __ThinkingBaseValue ? __ThinkingBaseValue.Thinking : default; var thinkingEnabled = CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled) ? parseResult.GetValue(ThinkingOptions.Enabled) : (__ThinkingBase is { } __ThinkingenabledBaseValue ? __ThinkingenabledBaseValue.Enabled : default); - var __ThinkingSpecified = CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled); - var thinking = - __ThinkingSpecified || __ThinkingBase is not null - ? new global::DeepInfra.AnthropicThinkingConfig - { - Enabled = thinkingEnabled, - - } - : __ThinkingBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.AnthropicMessagesCountTokensAsync( - xApiKey: xApiKey, - model: model, - messages: messages, - system: system, - tools: tools, - toolChoice: toolChoice, - thinking: thinking, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AnthropicThinkingConfigOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/AnthropicThinkingConfigOptionSet.g.cs index cdd1e0d1..694d671a 100644 --- a/src/cli/DeepInfra.CLI/Commands/AnthropicThinkingConfigOptionSet.g.cs +++ b/src/cli/DeepInfra.CLI/Commands/AnthropicThinkingConfigOptionSet.g.cs @@ -5,7 +5,8 @@ namespace DeepInfra.CLI.Commands; internal sealed record AnthropicThinkingConfigOptionSet( - Option Enabled) + Option BudgetTokens, + Option Enabled) { public static AnthropicThinkingConfigOptionSet Create(string? prefix = null) { @@ -13,7 +14,11 @@ public static AnthropicThinkingConfigOptionSet Create(string? prefix = null) ? string.Empty : prefix.Trim().Trim('-') + "-"; return new AnthropicThinkingConfigOptionSet( - Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"") + BudgetTokens: new Option($"--{normalizedPrefix}budget-tokens") + { + Description = @"", + }, + Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"") ); } } \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs index 6004ddc0..bfc45904 100644 --- a/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs +++ b/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs @@ -10,7 +10,27 @@ public static Command Create() { var command = new Command("api", "Generated endpoint commands."); - command.Subcommands.Add(DefaultApiGroupCommand.Create()); + command.Subcommands.Add(AccountApiGroupCommand.Create()); + command.Subcommands.Add(AgentsApiGroupCommand.Create()); + command.Subcommands.Add(AudioApiGroupCommand.Create()); + command.Subcommands.Add(AuthenticationApiGroupCommand.Create()); + command.Subcommands.Add(BillingApiGroupCommand.Create()); + command.Subcommands.Add(ChatCompletionsApiGroupCommand.Create()); + command.Subcommands.Add(DedicatedModelsApiGroupCommand.Create()); + command.Subcommands.Add(EmbeddingsApiGroupCommand.Create()); + command.Subcommands.Add(FilesBatchesApiGroupCommand.Create()); + command.Subcommands.Add(GPURentalsApiGroupCommand.Create()); + command.Subcommands.Add(ImageGenerationApiGroupCommand.Create()); + command.Subcommands.Add(InferenceApiGroupCommand.Create()); + command.Subcommands.Add(LogsMetricsApiGroupCommand.Create()); + command.Subcommands.Add(LoRAAdaptersApiGroupCommand.Create()); + command.Subcommands.Add(ModelsApiGroupCommand.Create()); + command.Subcommands.Add(SandboxesApiGroupCommand.Create()); + command.Subcommands.Add(TextCompletionsApiGroupCommand.Create()); + command.Subcommands.Add(TextToSpeechApiGroupCommand.Create()); + command.Subcommands.Add(TokenizerApiGroupCommand.Create()); + command.Subcommands.Add(UtilitiesApiGroupCommand.Create()); + command.Subcommands.Add(VideosApiGroupCommand.Create()); return command; } } \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AudioApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AudioApiGroupCommand.g.cs new file mode 100644 index 00000000..ccedf374 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioApiGroupCommand.g.cs @@ -0,0 +1,17 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class AudioApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"audio", @"Audio endpoint commands."); + command.Subcommands.Add(AudioOpenaiAudioSpeechCommandApiCommand.Create()); + command.Subcommands.Add(AudioOpenaiAudioTranscriptionsCommandApiCommand.Create()); + command.Subcommands.Add(AudioOpenaiAudioTranslationsCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioSpeechCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioSpeechCommandApiCommand.g.cs new file mode 100644 index 00000000..86f73f52 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioSpeechCommandApiCommand.g.cs @@ -0,0 +1,189 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AudioOpenaiAudioSpeechCommandApiCommand +{ + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.", + }; + + private static Option FailFast { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--fail-fast", + description: @"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior."); + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"model name", + Required = true, + }; + + private static Option InputOption { get; } = new( + name: @"--input") + { + Description = @"Text to convert to speech", + Required = true, + }; + + private static Option Voice { get; } = new( + name: @"--voice") + { + Description = @"Preset voices to use for the speech.", + }; + + private static Option ResponseFormat { get; } = new( + name: @"--response-format") + { + Description = @"response format for the speech", + }; + + private static Option Speed { get; } = new( + name: @"--speed") + { + Description = @"speed of the speech", + }; + + private static Option ExtraBody { get; } = new( + name: @"--extra-body") + { + Description = @"Extra body parameters for the model.", + }; + private static Option RequestInput { get; } = new(@"--request-input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-audio-speech", @"Openai Audio Speech"); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ServiceTier); + command.Options.Add(FailFast); + command.Options.Add(Model); + command.Options.Add(InputOption); + command.Options.Add(Voice); + command.Options.Add(ResponseFormat); + command.Options.Add(Speed); + command.Options.Add(ExtraBody); + command.Options.Add(RequestInput); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(RequestInput) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --request-input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + RequestInput, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + var failFast = CliRuntime.WasSpecified(parseResult, FailFast) ? parseResult.GetValue(FailFast) : (__requestBase is { } __FailFastBaseValue ? __FailFastBaseValue.FailFast : default); + var model = parseResult.GetRequiredValue(Model); + var input = parseResult.GetRequiredValue(InputOption); + var voice = CliRuntime.WasSpecified(parseResult, Voice) ? parseResult.GetValue(Voice) : (__requestBase is { } __VoiceBaseValue ? __VoiceBaseValue.Voice : default); + var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); + var speed = CliRuntime.WasSpecified(parseResult, Speed) ? parseResult.GetValue(Speed) : (__requestBase is { } __SpeedBaseValue ? __SpeedBaseValue.Speed : default); + var extraBody = CliRuntime.WasSpecified(parseResult, ExtraBody) ? parseResult.GetValue(ExtraBody) : (__requestBase is { } __ExtraBodyBaseValue ? __ExtraBodyBaseValue.ExtraBody : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Audio.OpenaiAudioSpeechAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + serviceTier: serviceTier, + failFast: failFast, + model: model, + input: input, + voice: voice, + responseFormat: responseFormat, + speed: speed, + extraBody: extraBody, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranscriptionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranscriptionsCommandApiCommand.g.cs new file mode 100644 index 00000000..5d4ed272 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranscriptionsCommandApiCommand.g.cs @@ -0,0 +1,201 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AudioOpenaiAudioTranscriptionsCommandApiCommand +{ + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option File { get; } = new( + name: @"--file") + { + Description = @"", + Required = true, + }; + + private static Option Filename { get; } = new( + name: @"--filename") + { + Description = @"", + Required = true, + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"", + Required = true, + }; + + private static Option Language { get; } = new( + name: @"--language") + { + Description = @"", + }; + + private static Option Prompt { get; } = new( + name: @"--prompt") + { + Description = @"", + }; + + private static Option ResponseFormat { get; } = new( + name: @"--response-format") + { + Description = @"", + }; + + private static Option Temperature { get; } = new( + name: @"--temperature") + { + Description = @"", + }; + + private static Option?> TimestampGranularities { get; } = new( + name: @"--timestamp-granularities") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-audio-transcriptions", @"Openai Audio Transcriptions"); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(File); + command.Options.Add(Filename); + command.Options.Add(Model); + command.Options.Add(Language); + command.Options.Add(Prompt); + command.Options.Add(ResponseFormat); + command.Options.Add(Temperature); + command.Options.Add(TimestampGranularities); + command.Options.Add(ServiceTier); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var file = parseResult.GetRequiredValue(File); + var filename = parseResult.GetRequiredValue(Filename); + var model = parseResult.GetRequiredValue(Model); + var language = CliRuntime.WasSpecified(parseResult, Language) ? parseResult.GetValue(Language) : (__requestBase is { } __LanguageBaseValue ? __LanguageBaseValue.Language : default); + var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); + var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); + var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); + var timestampGranularities = CliRuntime.WasSpecified(parseResult, TimestampGranularities) ? parseResult.GetValue(TimestampGranularities) : (__requestBase is { } __TimestampGranularitiesBaseValue ? __TimestampGranularitiesBaseValue.TimestampGranularities : default); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Audio.OpenaiAudioTranscriptionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + file: file, + filename: filename, + model: model, + language: language, + prompt: prompt, + responseFormat: responseFormat, + temperature: temperature, + timestampGranularities: timestampGranularities, + serviceTier: serviceTier, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranslationsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranslationsCommandApiCommand.g.cs new file mode 100644 index 00000000..aebee002 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranslationsCommandApiCommand.g.cs @@ -0,0 +1,183 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AudioOpenaiAudioTranslationsCommandApiCommand +{ + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option File { get; } = new( + name: @"--file") + { + Description = @"", + Required = true, + }; + + private static Option Filename { get; } = new( + name: @"--filename") + { + Description = @"", + Required = true, + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"", + Required = true, + }; + + private static Option Prompt { get; } = new( + name: @"--prompt") + { + Description = @"", + }; + + private static Option ResponseFormat { get; } = new( + name: @"--response-format") + { + Description = @"", + }; + + private static Option Temperature { get; } = new( + name: @"--temperature") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-audio-translations", @"Openai Audio Translations"); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(File); + command.Options.Add(Filename); + command.Options.Add(Model); + command.Options.Add(Prompt); + command.Options.Add(ResponseFormat); + command.Options.Add(Temperature); + command.Options.Add(ServiceTier); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var file = parseResult.GetRequiredValue(File); + var filename = parseResult.GetRequiredValue(Filename); + var model = parseResult.GetRequiredValue(Model); + var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); + var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); + var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Audio.OpenaiAudioTranslationsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + file: file, + filename: filename, + model: model, + prompt: prompt, + responseFormat: responseFormat, + temperature: temperature, + serviceTier: serviceTier, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationApiGroupCommand.g.cs new file mode 100644 index 00000000..9ccc25cd --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationApiGroupCommand.g.cs @@ -0,0 +1,28 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class AuthenticationApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"authentication", @"Authentication endpoint commands."); + command.Subcommands.Add(AuthenticationCreateApiTokenCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationCreateScopedJwtCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationCreateSshKeyCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationDeleteApiTokenCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationDeleteSshKeyCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationExportApiTokenToVercelCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationGetApiTokenCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationGetApiTokensCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationGetSshKeysCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationGithubCliLoginCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationGithubLoginCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationGoogleLoginCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationInspectScopedJwtCommandApiCommand.Create()); + command.Subcommands.Add(AuthenticationOktaLoginCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateApiTokenCommandApiCommand.g.cs new file mode 100644 index 00000000..0a265cae --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateApiTokenCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationCreateApiTokenCommandApiCommand +{ + private static Argument NameOption { get; } = new( + name: @"name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ApiToken value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ApiToken value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-api-token", @"Create Api Token"); + command.Arguments.Add(NameOption); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var name = parseResult.GetRequiredValue(NameOption); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.CreateApiTokenAsync( + name: name, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateScopedJwtCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateScopedJwtCommandApiCommand.g.cs new file mode 100644 index 00000000..a9469fa8 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateScopedJwtCommandApiCommand.g.cs @@ -0,0 +1,154 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationCreateScopedJwtCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ApiKeyName { get; } = new( + name: @"--api-key-name") + { + Description = @"", + Required = true, + }; + + private static Option?> Models { get; } = new( + name: @"--models") + { + Description = @"allow inference only to the specified model names", + }; + + private static Option ExpiresDelta { get; } = new( + name: @"--expires-delta") + { + Description = @"how many seconds in the future should the token be valid for", + }; + + private static Option ExpiresAt { get; } = new( + name: @"--expires-at") + { + Description = @"unix timestamp when the token should expire", + }; + + private static Option SpendingLimit { get; } = new( + name: @"--spending-limit") + { + Description = @"only allow spending that much USD until the token becomes invalid", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ScopedJWTOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ScopedJWTOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-scoped-jwt", @" Create Scoped Jwt"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ApiKeyName); + command.Options.Add(Models); + command.Options.Add(ExpiresDelta); + command.Options.Add(ExpiresAt); + command.Options.Add(SpendingLimit); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var apiKeyName = parseResult.GetRequiredValue(ApiKeyName); + var models = CliRuntime.WasSpecified(parseResult, Models) ? parseResult.GetValue(Models) : (__requestBase is { } __ModelsBaseValue ? __ModelsBaseValue.Models : default); + var expiresDelta = CliRuntime.WasSpecified(parseResult, ExpiresDelta) ? parseResult.GetValue(ExpiresDelta) : (__requestBase is { } __ExpiresDeltaBaseValue ? __ExpiresDeltaBaseValue.ExpiresDelta : default); + var expiresAt = CliRuntime.WasSpecified(parseResult, ExpiresAt) ? parseResult.GetValue(ExpiresAt) : (__requestBase is { } __ExpiresAtBaseValue ? __ExpiresAtBaseValue.ExpiresAt : default); + var spendingLimit = CliRuntime.WasSpecified(parseResult, SpendingLimit) ? parseResult.GetValue(SpendingLimit) : (__requestBase is { } __SpendingLimitBaseValue ? __SpendingLimitBaseValue.SpendingLimit : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.CreateScopedJwtAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + apiKeyName: apiKeyName, + models: models, + expiresDelta: expiresDelta, + expiresAt: expiresAt, + spendingLimit: spendingLimit, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateSshKeyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateSshKeyCommandApiCommand.g.cs new file mode 100644 index 00000000..719a227f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationCreateSshKeyCommandApiCommand.g.cs @@ -0,0 +1,92 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationCreateSshKeyCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option NameOption { get; } = new( + name: @"--name") + { + Description = @"SSH Key name", + Required = true, + }; + + private static Option Key { get; } = new( + name: @"--key") + { + Description = @"SSH Key content", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.SshKeyOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.SshKeyOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-ssh-key", @"Create Ssh Key"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(NameOption); + command.Options.Add(Key); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var name = parseResult.GetRequiredValue(NameOption); + var key = parseResult.GetRequiredValue(Key); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.CreateSshKeyAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + name: name, + key: key, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationDeleteApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationDeleteApiTokenCommandApiCommand.g.cs new file mode 100644 index 00000000..e2602ffd --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationDeleteApiTokenCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationDeleteApiTokenCommandApiCommand +{ + private static Argument ApiToken { get; } = new( + name: @"api-token") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-api-token", @"Delete Api Token"); + command.Arguments.Add(ApiToken); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var apiToken = parseResult.GetRequiredValue(ApiToken); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.DeleteApiTokenAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationDeleteSshKeyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationDeleteSshKeyCommandApiCommand.g.cs new file mode 100644 index 00000000..d174b31d --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationDeleteSshKeyCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationDeleteSshKeyCommandApiCommand +{ + private static Argument SshKeyId { get; } = new( + name: @"ssh-key-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-ssh-key", @"Delete Ssh Key"); + command.Arguments.Add(SshKeyId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sshKeyId = parseResult.GetRequiredValue(SshKeyId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.DeleteSshKeyAsync( + sshKeyId: sshKeyId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationExportApiTokenToVercelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationExportApiTokenToVercelCommandApiCommand.g.cs new file mode 100644 index 00000000..5b21d29a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationExportApiTokenToVercelCommandApiCommand.g.cs @@ -0,0 +1,131 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationExportApiTokenToVercelCommandApiCommand +{ + private static Argument ApiToken { get; } = new( + name: @"api-token") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ProjectIdOrName { get; } = new( + name: @"--project-id-or-name") + { + Description = @"", + Required = true, + }; + + private static Option IsSensitive { get; } = new( + name: @"--is-sensitive") + { + Description = @"", + Required = true, + }; + + private static Option EnvDevelopment { get; } = new( + name: @"--env-development") + { + Description = @"", + Required = true, + }; + + private static Option EnvPreview { get; } = new( + name: @"--env-preview") + { + Description = @"", + Required = true, + }; + + private static Option EnvProduction { get; } = new( + name: @"--env-production") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"export-api-token-to-vercel", @"Export Api Token To Vercel"); + command.Arguments.Add(ApiToken); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ProjectIdOrName); + command.Options.Add(IsSensitive); + command.Options.Add(EnvDevelopment); + command.Options.Add(EnvPreview); + command.Options.Add(EnvProduction); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var apiToken = parseResult.GetRequiredValue(ApiToken); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var projectIdOrName = parseResult.GetRequiredValue(ProjectIdOrName); + var isSensitive = parseResult.GetRequiredValue(IsSensitive); + var envDevelopment = parseResult.GetRequiredValue(EnvDevelopment); + var envPreview = parseResult.GetRequiredValue(EnvPreview); + var envProduction = parseResult.GetRequiredValue(EnvProduction); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.ExportApiTokenToVercelAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + projectIdOrName: projectIdOrName, + isSensitive: isSensitive, + envDevelopment: envDevelopment, + envPreview: envPreview, + envProduction: envProduction, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationGetApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationGetApiTokenCommandApiCommand.g.cs new file mode 100644 index 00000000..4c8167dc --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationGetApiTokenCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationGetApiTokenCommandApiCommand +{ + private static Argument ApiToken { get; } = new( + name: @"api-token") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ApiToken value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ApiToken value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-api-token", @"Get Api Token"); + command.Arguments.Add(ApiToken); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var apiToken = parseResult.GetRequiredValue(ApiToken); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.GetApiTokenAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationGetApiTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationGetApiTokensCommandApiCommand.g.cs new file mode 100644 index 00000000..b0632f9f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationGetApiTokensCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationGetApiTokensCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-api-tokens", @"Get Api Tokens"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.GetApiTokensAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationGetSshKeysCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationGetSshKeysCommandApiCommand.g.cs new file mode 100644 index 00000000..279d34f4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationGetSshKeysCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationGetSshKeysCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-ssh-keys", @"Get Ssh Keys"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.GetSshKeysAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationGithubCliLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationGithubCliLoginCommandApiCommand.g.cs new file mode 100644 index 00000000..e812a844 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationGithubCliLoginCommandApiCommand.g.cs @@ -0,0 +1,66 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationGithubCliLoginCommandApiCommand +{ + private static Option LoginId { get; } = new( + name: @"--login-id") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"github-cli-login", @"Github Cli Login +deepctl is calling this request waiting for auth token during login. +The token is stored in /github/callback"); + command.Options.Add(LoginId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loginId = parseResult.GetRequiredValue(LoginId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.GithubCliLoginAsync( + loginId: loginId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationGithubLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationGithubLoginCommandApiCommand.g.cs new file mode 100644 index 00000000..5957ea5c --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationGithubLoginCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationGithubLoginCommandApiCommand +{ + private static Option LoginId { get; } = new( + name: @"--login-id") + { + Description = @"", + }; + + private static Option Origin { get; } = new( + name: @"--origin") + { + Description = @"", + }; + + private static Option Deal { get; } = new( + name: @"--deal") + { + Description = @"", + }; + + private static Option TiToken { get; } = new( + name: @"--ti-token") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"github-login", @"Github Login +Initiate github SSO login flow. Callback is /github/callback"); + command.Options.Add(LoginId); + command.Options.Add(Origin); + command.Options.Add(Deal); + command.Options.Add(TiToken); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loginId = parseResult.GetValue(LoginId); + var origin = parseResult.GetValue(Origin); + var deal = parseResult.GetValue(Deal); + var tiToken = parseResult.GetValue(TiToken); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.GithubLoginAsync( + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationGoogleLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationGoogleLoginCommandApiCommand.g.cs new file mode 100644 index 00000000..8048f0b0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationGoogleLoginCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationGoogleLoginCommandApiCommand +{ + private static Option LoginId { get; } = new( + name: @"--login-id") + { + Description = @"", + }; + + private static Option Origin { get; } = new( + name: @"--origin") + { + Description = @"", + }; + + private static Option Deal { get; } = new( + name: @"--deal") + { + Description = @"", + }; + + private static Option TiToken { get; } = new( + name: @"--ti-token") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"google-login", @"Google Login +Initiate Google SSO login flow. Callback is /google/callback"); + command.Options.Add(LoginId); + command.Options.Add(Origin); + command.Options.Add(Deal); + command.Options.Add(TiToken); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loginId = parseResult.GetValue(LoginId); + var origin = parseResult.GetValue(Origin); + var deal = parseResult.GetValue(Deal); + var tiToken = parseResult.GetValue(TiToken); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.GoogleLoginAsync( + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationInspectScopedJwtCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationInspectScopedJwtCommandApiCommand.g.cs new file mode 100644 index 00000000..2bd29835 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationInspectScopedJwtCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationInspectScopedJwtCommandApiCommand +{ + private static Option Jwtoken { get; } = new( + name: @"--jwtoken") + { + Description = @"", + Required = true, + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.InspectScopedJWTOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.InspectScopedJWTOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"inspect-scoped-jwt", @"Inspect Scoped Jwt"); + command.Options.Add(Jwtoken); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var jwtoken = parseResult.GetRequiredValue(Jwtoken); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.InspectScopedJwtAsync( + jwtoken: jwtoken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AuthenticationOktaLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AuthenticationOktaLoginCommandApiCommand.g.cs new file mode 100644 index 00000000..c035913f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationOktaLoginCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AuthenticationOktaLoginCommandApiCommand +{ + private static Option TeamId { get; } = new( + name: @"--team-id") + { + Description = @"", + Required = true, + }; + + private static Option Origin { get; } = new( + name: @"--origin") + { + Description = @"", + }; + + private static Option LoginId { get; } = new( + name: @"--login-id") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"okta-login", @"Okta Login"); + command.Options.Add(TeamId); + command.Options.Add(Origin); + command.Options.Add(LoginId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var teamId = parseResult.GetRequiredValue(TeamId); + var origin = parseResult.GetValue(Origin); + var loginId = parseResult.GetValue(LoginId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Authentication.OktaLoginAsync( + teamId: teamId, + origin: origin, + loginId: loginId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingAddFundsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingAddFundsCommandApiCommand.g.cs new file mode 100644 index 00000000..ac735879 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingAddFundsCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingAddFundsCommandApiCommand +{ + private static Option UseCheckout { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--use-checkout", + description: @""); + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static Option Amount { get; } = new( + name: @"--amount") + { + Description = @"Amount to add in cents", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.AddFundsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.AddFundsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"add-funds", @"Add Funds"); + command.Options.Add(UseCheckout); + command.Options.Add(Session); + command.Options.Add(Amount); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var useCheckout = parseResult.GetValue(UseCheckout); + var session = parseResult.GetValue(Session); + var amount = parseResult.GetRequiredValue(Amount); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.AddFundsAsync( + useCheckout: useCheckout, + session: session, + amount: amount, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingApiGroupCommand.g.cs new file mode 100644 index 00000000..2f313e90 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingApiGroupCommand.g.cs @@ -0,0 +1,26 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class BillingApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"billing", @"Billing endpoint commands."); + command.Subcommands.Add(BillingAddFundsCommandApiCommand.Create()); + command.Subcommands.Add(BillingBillingPortalCommandApiCommand.Create()); + command.Subcommands.Add(BillingDeepstartApplyCommandApiCommand.Create()); + command.Subcommands.Add(BillingGetChecklistCommandApiCommand.Create()); + command.Subcommands.Add(BillingGetConfigCommandApiCommand.Create()); + command.Subcommands.Add(BillingListInvoicesCommandApiCommand.Create()); + command.Subcommands.Add(BillingSetConfigCommandApiCommand.Create()); + command.Subcommands.Add(BillingSetupTopupCommandApiCommand.Create()); + command.Subcommands.Add(BillingUsageCommandApiCommand.Create()); + command.Subcommands.Add(BillingUsageApiTokenCommandApiCommand.Create()); + command.Subcommands.Add(BillingUsageRentCommandApiCommand.Create()); + command.Subcommands.Add(BillingUsageTokensCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingBillingPortalCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingBillingPortalCommandApiCommand.g.cs new file mode 100644 index 00000000..265d04c7 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingBillingPortalCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingBillingPortalCommandApiCommand +{ + private static Option ReturnUrl { get; } = new( + name: @"--return-url") + { + Description = @"", + }; + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.BillingPortalOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.BillingPortalOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"portal", @"Billing Portal"); + command.Options.Add(ReturnUrl); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var returnUrl = parseResult.GetValue(ReturnUrl); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.BillingPortalAsync( + returnUrl: returnUrl, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingDeepstartApplyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingDeepstartApplyCommandApiCommand.g.cs new file mode 100644 index 00000000..dfef0136 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingDeepstartApplyCommandApiCommand.g.cs @@ -0,0 +1,194 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingDeepstartApplyCommandApiCommand +{ + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static Option Id { get; } = new( + name: @"--id") + { + Description = @"", + }; + + private static Option Uid { get; } = new( + name: @"--uid") + { + Description = @"", + }; + + private static Option Company { get; } = new( + name: @"--company") + { + Description = @"", + Required = true, + }; + + private static Option Ceo { get; } = new( + name: @"--ceo") + { + Description = @"", + Required = true, + }; + + private static Option Funding { get; } = new( + name: @"--funding") + { + Description = @"", + Required = true, + }; + + private static Option FoundedOn { get; } = new( + name: @"--founded-on") + { + Description = @"", + Required = true, + }; + + private static Option Website { get; } = new( + name: @"--website") + { + Description = @"", + Required = true, + }; + + private static Option CreatedAt { get; } = new( + name: @"--created-at") + { + Description = @"", + }; + + private static Option Status { get; } = new( + name: @"--status") + { + Description = @"", + }; + + private static Option Deal { get; } = new( + name: @"--deal") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeepStartApplicationOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeepStartApplicationOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deepstart-apply", @"Deepstart Apply"); + command.Options.Add(Session); + command.Options.Add(Id); + command.Options.Add(Uid); + command.Options.Add(Company); + command.Options.Add(Ceo); + command.Options.Add(Funding); + command.Options.Add(FoundedOn); + command.Options.Add(Website); + command.Options.Add(CreatedAt); + command.Options.Add(Status); + command.Options.Add(Deal); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var session = parseResult.GetValue(Session); + var id = CliRuntime.WasSpecified(parseResult, Id) ? parseResult.GetValue(Id) : (__requestBase is { } __IdBaseValue ? __IdBaseValue.Id : default); + var uid = CliRuntime.WasSpecified(parseResult, Uid) ? parseResult.GetValue(Uid) : (__requestBase is { } __UidBaseValue ? __UidBaseValue.Uid : default); + var company = parseResult.GetRequiredValue(Company); + var ceo = parseResult.GetRequiredValue(Ceo); + var funding = parseResult.GetRequiredValue(Funding); + var foundedOn = parseResult.GetRequiredValue(FoundedOn); + var website = parseResult.GetRequiredValue(Website); + var createdAt = CliRuntime.WasSpecified(parseResult, CreatedAt) ? parseResult.GetValue(CreatedAt) : (__requestBase is { } __CreatedAtBaseValue ? __CreatedAtBaseValue.CreatedAt : default); + var status = CliRuntime.WasSpecified(parseResult, Status) ? parseResult.GetValue(Status) : (__requestBase is { } __StatusBaseValue ? __StatusBaseValue.Status : default); + var deal = CliRuntime.WasSpecified(parseResult, Deal) ? parseResult.GetValue(Deal) : (__requestBase is { } __DealBaseValue ? __DealBaseValue.Deal : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.DeepstartApplyAsync( + session: session, + id: id, + uid: uid, + company: company, + ceo: ceo, + funding: funding, + foundedOn: foundedOn, + website: website, + createdAt: createdAt, + status: status, + deal: deal, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingGetChecklistCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingGetChecklistCommandApiCommand.g.cs new file mode 100644 index 00000000..5c271366 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingGetChecklistCommandApiCommand.g.cs @@ -0,0 +1,70 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingGetChecklistCommandApiCommand +{ + private static Option ComputeOwed { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--compute-owed", + description: @""); + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Checklist value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Checklist value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-checklist", @"Get Checklist"); + command.Options.Add(ComputeOwed); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var computeOwed = parseResult.GetValue(ComputeOwed); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.GetChecklistAsync( + computeOwed: computeOwed, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingGetConfigCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingGetConfigCommandApiCommand.g.cs new file mode 100644 index 00000000..c8ff8078 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingGetConfigCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingGetConfigCommandApiCommand +{ + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ConfigOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ConfigOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-config", @"Get Config"); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.GetConfigAsync( + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingListInvoicesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingListInvoicesCommandApiCommand.g.cs new file mode 100644 index 00000000..a38b4dce --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingListInvoicesCommandApiCommand.g.cs @@ -0,0 +1,98 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingListInvoicesCommandApiCommand +{ + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"", + }; + + private static Option StartingAfter { get; } = new( + name: @"--starting-after") + { + Description = @"", + }; + + private static Option InvoiceType { get; } = new( + name: @"--invoice-type") + { + Description = @"", + }; + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.InvoicesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.InvoicesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list-invoices", @"List Invoices"); + command.Options.Add(Limit); + command.Options.Add(StartingAfter); + command.Options.Add(InvoiceType); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var limit = parseResult.GetValue(Limit); + var startingAfter = parseResult.GetValue(StartingAfter); + var invoiceType = parseResult.GetValue(InvoiceType); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.ListInvoicesAsync( + limit: limit, + startingAfter: startingAfter, + invoiceType: invoiceType, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Invoices", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingPortalCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingPortalCommandApiCommand.g.cs deleted file mode 100644 index c4813b33..00000000 --- a/src/cli/DeepInfra.CLI/Commands/BillingPortalCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class BillingPortalCommandApiCommand -{ - private static Option ReturnUrl { get; } = new( - name: @"--return-url") - { - Description = @"", - }; - - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.BillingPortalOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.BillingPortalOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"billing-portal", @"Billing Portal"); - command.Options.Add(ReturnUrl); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var returnUrl = parseResult.GetValue(ReturnUrl); - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.BillingPortalAsync( - returnUrl: returnUrl, - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingSetConfigCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingSetConfigCommandApiCommand.g.cs new file mode 100644 index 00000000..56769d98 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingSetConfigCommandApiCommand.g.cs @@ -0,0 +1,108 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingSetConfigCommandApiCommand +{ + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"Set usage limit (in USD). Negative means no limit.null/not-set means don't change it", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ConfigOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ConfigOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"set-config", @"Set Config"); + command.Options.Add(Session); + command.Options.Add(Limit); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var session = parseResult.GetValue(Session); + var limit = CliRuntime.WasSpecified(parseResult, Limit) ? parseResult.GetValue(Limit) : (__requestBase is { } __LimitBaseValue ? __LimitBaseValue.Limit : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.SetConfigAsync( + session: session, + limit: limit, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingSetupTopupCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingSetupTopupCommandApiCommand.g.cs new file mode 100644 index 00000000..9e600a66 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingSetupTopupCommandApiCommand.g.cs @@ -0,0 +1,124 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingSetupTopupCommandApiCommand +{ + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static Option Amount { get; } = new( + name: @"--amount") + { + Description = @"Amount to top up in cents", + }; + + private static Option Threshold { get; } = new( + name: @"--threshold") + { + Description = @"Top up threshold in cents, if balance goes below this value, top up will be triggered", + }; + + private static Option Enabled { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--enabled", + description: @"If true, top up will be triggered when balance goes below threshold"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"setup-topup", @"Setup Topup"); + command.Options.Add(Session); + command.Options.Add(Amount); + command.Options.Add(Threshold); + command.Options.Add(Enabled); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var session = parseResult.GetValue(Session); + var amount = CliRuntime.WasSpecified(parseResult, Amount) ? parseResult.GetValue(Amount) : (__requestBase is { } __AmountBaseValue ? __AmountBaseValue.Amount : default); + var threshold = CliRuntime.WasSpecified(parseResult, Threshold) ? parseResult.GetValue(Threshold) : (__requestBase is { } __ThresholdBaseValue ? __ThresholdBaseValue.Threshold : default); + var enabled = CliRuntime.WasSpecified(parseResult, Enabled) ? parseResult.GetValue(Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.SetupTopupAsync( + session: session, + amount: amount, + threshold: threshold, + enabled: enabled, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingUsageApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingUsageApiTokenCommandApiCommand.g.cs new file mode 100644 index 00000000..9b2d5f16 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingUsageApiTokenCommandApiCommand.g.cs @@ -0,0 +1,99 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingUsageApiTokenCommandApiCommand +{ + private static Argument ApiToken { get; } = new( + name: @"api-token") + { + Description = @"", + }; + + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period (if missing a single month marked by from is return), same format as from", + }; + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"usage-api-token", @"Usage Api Token"); + command.Arguments.Add(ApiToken); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var apiToken = parseResult.GetRequiredValue(ApiToken); + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.UsageApiTokenAsync( + apiToken: apiToken, + from: from, + to: to, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Months", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingUsageCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingUsageCommandApiCommand.g.cs new file mode 100644 index 00000000..6b57d6bb --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingUsageCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingUsageCommandApiCommand +{ + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period (if missing a single month marked by from is return), same format as from", + }; + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"usage", @"Usage"); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.UsageAsync( + from: from, + to: to, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Months", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingUsageRentCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingUsageRentCommandApiCommand.g.cs new file mode 100644 index 00000000..28e1529a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingUsageRentCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingUsageRentCommandApiCommand +{ + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period, in seconds since unix epoch", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period, in seconds since unix epoch", + }; + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageRentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageRentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"usage-rent", @"Usage Rent"); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.UsageRentAsync( + from: from, + to: to, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/BillingUsageTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/BillingUsageTokensCommandApiCommand.g.cs new file mode 100644 index 00000000..b71d6a25 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/BillingUsageTokensCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class BillingUsageTokensCommandApiCommand +{ + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period (if missing a single month marked by from is return), same format as from", + }; + + private static Option Session { get; } = new( + name: @"--session") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"usage-tokens", @"Usage Tokens"); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(Session); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var session = parseResult.GetValue(Session); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Billing.UsageTokensAsync( + from: from, + to: to, + session: session, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Months", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCommandApiCommand.g.cs new file mode 100644 index 00000000..cbb68394 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCommandApiCommand.g.cs @@ -0,0 +1,302 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ChatCompletionsAnthropicMessagesCommandApiCommand +{ + private static Option AnthropicVersion { get; } = new( + name: @"--anthropic-version") + { + Description = @"", + }; + + private static Option AnthropicBeta { get; } = new( + name: @"--anthropic-beta") + { + Description = @"", + }; + + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option XDeepinfraServiceTier { get; } = new( + name: @"--x-deepinfra-service-tier") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.", + }; + + private static Option FailFast { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--fail-fast", + description: @"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior."); + + private static Option?> Models { get; } = new( + name: @"--models") + { + Description = @"Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence.", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"", + Required = true, + }; + + private static Option MaxTokens { get; } = new( + name: @"--max-tokens") + { + Description = @"", + }; + + private static Option> Messages { get; } = new( + name: @"--messages") + { + Description = @"", + Required = true, + }; + + private static Option, object>?> System { get; } = new( + name: @"--system") + { + Description = @"", + }; + + private static Option?> StopSequences { get; } = new( + name: @"--stop-sequences") + { + Description = @"", + }; + + private static Option Stream { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--stream", + description: @""); + + private static Option Temperature { get; } = new( + name: @"--temperature") + { + Description = @"", + }; + + private static Option TopP { get; } = new( + name: @"--top-p") + { + Description = @"", + }; + + private static Option TopK { get; } = new( + name: @"--top-k") + { + Description = @"", + }; + + private static Option Metadata { get; } = new( + name: @"--metadata") + { + Description = @"", + }; + + private static Option?> Tools { get; } = new( + name: @"--tools") + { + Description = @"", + }; + + private static Option ToolChoice { get; } = new( + name: @"--tool-choice") + { + Description = @"", + }; + + private static Option PromptCacheKey { get; } = new( + name: @"--prompt-cache-key") + { + Description = @"", + }; + private static readonly AnthropicThinkingConfigOptionSet ThinkingOptions = AnthropicThinkingConfigOptionSet.Create(@"thinking"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"anthropic-messages", @"Anthropic Messages"); + command.Options.Add(AnthropicVersion); + command.Options.Add(AnthropicBeta); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XDeepinfraServiceTier); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ServiceTier); + command.Options.Add(FailFast); + command.Options.Add(Models); + command.Options.Add(Model); + command.Options.Add(MaxTokens); + command.Options.Add(Messages); + command.Options.Add(System); + command.Options.Add(StopSequences); + command.Options.Add(Stream); + command.Options.Add(Temperature); + command.Options.Add(TopP); + command.Options.Add(TopK); + command.Options.Add(Metadata); + command.Options.Add(Tools); + command.Options.Add(ToolChoice); + command.Options.Add(PromptCacheKey); command.Options.Add(ThinkingOptions.BudgetTokens); + command.Options.Add(ThinkingOptions.Enabled); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var anthropicVersion = parseResult.GetValue(AnthropicVersion); + var anthropicBeta = parseResult.GetValue(AnthropicBeta); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xDeepinfraServiceTier = parseResult.GetValue(XDeepinfraServiceTier); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + var failFast = CliRuntime.WasSpecified(parseResult, FailFast) ? parseResult.GetValue(FailFast) : (__requestBase is { } __FailFastBaseValue ? __FailFastBaseValue.FailFast : default); + var models = CliRuntime.WasSpecified(parseResult, Models) ? parseResult.GetValue(Models) : (__requestBase is { } __ModelsBaseValue ? __ModelsBaseValue.Models : default); + var model = parseResult.GetRequiredValue(Model); + var maxTokens = CliRuntime.WasSpecified(parseResult, MaxTokens) ? parseResult.GetValue(MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); + var messages = parseResult.GetRequiredValue(Messages); + var system = CliRuntime.WasSpecified(parseResult, System) ? parseResult.GetValue(System) : (__requestBase is { } __SystemBaseValue ? __SystemBaseValue.System : default); + var stopSequences = CliRuntime.WasSpecified(parseResult, StopSequences) ? parseResult.GetValue(StopSequences) : (__requestBase is { } __StopSequencesBaseValue ? __StopSequencesBaseValue.StopSequences : default); + var stream = CliRuntime.WasSpecified(parseResult, Stream) ? parseResult.GetValue(Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); + var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); + var topP = CliRuntime.WasSpecified(parseResult, TopP) ? parseResult.GetValue(TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); + var topK = CliRuntime.WasSpecified(parseResult, TopK) ? parseResult.GetValue(TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); + var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default); + var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); + var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); + var promptCacheKey = CliRuntime.WasSpecified(parseResult, PromptCacheKey) ? parseResult.GetValue(PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); + + var __ThinkingBase = __requestBase is { } __ThinkingBaseValue ? __ThinkingBaseValue.Thinking : default; var thinkingBudgetTokens = CliRuntime.WasSpecified(parseResult, ThinkingOptions.BudgetTokens) ? parseResult.GetValue(ThinkingOptions.BudgetTokens) : (__ThinkingBase is { } __ThinkingbudgetTokensBaseValue ? __ThinkingbudgetTokensBaseValue.BudgetTokens : default); + var thinkingEnabled = CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled) ? parseResult.GetValue(ThinkingOptions.Enabled) : (__ThinkingBase is { } __ThinkingenabledBaseValue ? __ThinkingenabledBaseValue.Enabled : default); + var __ThinkingSpecified = CliRuntime.WasSpecified(parseResult, ThinkingOptions.BudgetTokens) || CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled); + var thinking = + __ThinkingSpecified || __ThinkingBase is not null + ? new global::DeepInfra.AnthropicThinkingConfig + { + BudgetTokens = thinkingBudgetTokens, + Enabled = thinkingEnabled, + + } + : __ThinkingBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ChatCompletions.AnthropicMessagesAsync( + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + xDeepinfraServiceTier: xDeepinfraServiceTier, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + serviceTier: serviceTier, + failFast: failFast, + models: models, + model: model, + maxTokens: maxTokens, + messages: messages, + system: system, + stopSequences: stopSequences, + stream: stream, + temperature: temperature, + topP: topP, + topK: topK, + metadata: metadata, + tools: tools, + toolChoice: toolChoice, + promptCacheKey: promptCacheKey, + thinking: thinking, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.g.cs new file mode 100644 index 00000000..28f2e5c0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.g.cs @@ -0,0 +1,171 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"", + Required = true, + }; + + private static Option> Messages { get; } = new( + name: @"--messages") + { + Description = @"", + Required = true, + }; + + private static Option, object>?> System { get; } = new( + name: @"--system") + { + Description = @"", + }; + + private static Option?> Tools { get; } = new( + name: @"--tools") + { + Description = @"", + }; + + private static Option ToolChoice { get; } = new( + name: @"--tool-choice") + { + Description = @"", + }; + private static readonly AnthropicThinkingConfigOptionSet ThinkingOptions = AnthropicThinkingConfigOptionSet.Create(@"thinking"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"anthropic-messages-count-tokens", @"Anthropic Messages Count Tokens"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Model); + command.Options.Add(Messages); + command.Options.Add(System); + command.Options.Add(Tools); + command.Options.Add(ToolChoice); command.Options.Add(ThinkingOptions.BudgetTokens); + command.Options.Add(ThinkingOptions.Enabled); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var model = parseResult.GetRequiredValue(Model); + var messages = parseResult.GetRequiredValue(Messages); + var system = CliRuntime.WasSpecified(parseResult, System) ? parseResult.GetValue(System) : (__requestBase is { } __SystemBaseValue ? __SystemBaseValue.System : default); + var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); + var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); + + var __ThinkingBase = __requestBase is { } __ThinkingBaseValue ? __ThinkingBaseValue.Thinking : default; var thinkingBudgetTokens = CliRuntime.WasSpecified(parseResult, ThinkingOptions.BudgetTokens) ? parseResult.GetValue(ThinkingOptions.BudgetTokens) : (__ThinkingBase is { } __ThinkingbudgetTokensBaseValue ? __ThinkingbudgetTokensBaseValue.BudgetTokens : default); + var thinkingEnabled = CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled) ? parseResult.GetValue(ThinkingOptions.Enabled) : (__ThinkingBase is { } __ThinkingenabledBaseValue ? __ThinkingenabledBaseValue.Enabled : default); + var __ThinkingSpecified = CliRuntime.WasSpecified(parseResult, ThinkingOptions.BudgetTokens) || CliRuntime.WasSpecified(parseResult, ThinkingOptions.Enabled); + var thinking = + __ThinkingSpecified || __ThinkingBase is not null + ? new global::DeepInfra.AnthropicThinkingConfig + { + BudgetTokens = thinkingBudgetTokens, + Enabled = thinkingEnabled, + + } + : __ThinkingBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ChatCompletions.AnthropicMessagesCountTokensAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + model: model, + messages: messages, + system: system, + tools: tools, + toolChoice: toolChoice, + thinking: thinking, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ChatCompletionsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsApiGroupCommand.g.cs new file mode 100644 index 00000000..dae79973 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsApiGroupCommand.g.cs @@ -0,0 +1,17 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class ChatCompletionsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"chat-completions", @"Chat Completions endpoint commands."); + command.Subcommands.Add(ChatCompletionsAnthropicMessagesCommandApiCommand.Create()); + command.Subcommands.Add(ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.Create()); + command.Subcommands.Add(ChatCompletionsOpenaiChatCompletionsCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ChatCompletionsOpenaiChatCompletionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsOpenaiChatCompletionsCommandApiCommand.g.cs new file mode 100644 index 00000000..376a695b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsOpenaiChatCompletionsCommandApiCommand.g.cs @@ -0,0 +1,397 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ChatCompletionsOpenaiChatCompletionsCommandApiCommand +{ + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.", + }; + + private static Option FailFast { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--fail-fast", + description: @"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior."); + + private static Option?> Models { get; } = new( + name: @"--models") + { + Description = @"Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence.", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"model name", + Required = true, + }; + + private static Option>> Messages { get; } = new( + name: @"--messages") + { + Description = @"conversation messages: (user,assistant,tool)*,user including one system message anywhere", + Required = true, + }; + + private static Option Stream { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--stream", + description: @"whether to stream the output via SSE or return the full response"); + + private static Option Temperature { get; } = new( + name: @"--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", + }; + + private static Option TopP { get; } = new( + name: @"--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.", + }; + + private static Option MinP { get; } = new( + name: @"--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.", + }; + + private static Option TopK { get; } = new( + name: @"--top-k") + { + Description = @"Sample from the best k (number of) tokens. 0 means off", + }; + + private static Option MaxTokens { get; } = new( + name: @"--max-tokens") + { + Description = @"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 65536, whichever is smaller.", + }; + + private static Option, object>?> Stop { get; } = new( + name: @"--stop") + { + Description = @"up to 16 sequences where the API will stop generating further tokens", + }; + + private static Option?> StopTokenIds { get; } = new( + name: @"--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.", + }; + + private static Option N { get; } = new( + name: @"--n") + { + Description = @"number of sequences to return", + }; + + private static Option PresencePenalty { get; } = new( + name: @"--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.", + }; + + private static Option FrequencyPenalty { get; } = new( + name: @"--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.", + }; + + private static Option?> Tools { get; } = new( + name: @"--tools") + { + Description = @"A list of tools the model may call. Currently, only functions are supported as a tool.", + }; + + private static Option?> ToolChoice { get; } = new( + name: @"--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.", + }; + + private static Option?> ResponseFormat { get; } = new( + name: @"--response-format") + { + Description = @"The format of the response. Currently, only json is supported.", + }; + + private static Option RepetitionPenalty { get; } = new( + name: @"--repetition-penalty") + { + Description = @"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)", + }; + + private static Option User { get; } = new( + name: @"--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.", + }; + + private static Option Seed { get; } = new( + name: @"--seed") + { + Description = @"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed.", + }; + + private static Option Logprobs { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--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`."); + + private static Option ReasoningEffort { get; } = new( + name: @"--reasoning-effort") + { + Description = @"Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. 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.", + }; + + private static Option Reasoning { get; } = new( + name: @"--reasoning") + { + Description = @"Reasoning configuration.", + }; + + private static Option PromptCacheKey { get; } = new( + name: @"--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.", + }; + + private static Option PromptCacheOptions { get; } = new( + name: @"--prompt-cache-options") + { + Description = @"Prompt cache options for this request's prefix, e.g. {""ttl"": ""1h""}.", + }; + + private static Option ChatTemplateKwargs { get; } = new( + name: @"--chat-template-kwargs") + { + Description = @"Chat template kwargs.", + }; + + private static Option ContinueFinalMessage { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--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."); + + private static Option IgnoreEos { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--ignore-eos", + description: @"Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed."); + private static readonly StreamOptionsOptionSet StreamOptionsOptions = StreamOptionsOptionSet.Create(@"stream"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-chat-completions", @"Openai Chat Completions"); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ServiceTier); + command.Options.Add(FailFast); + command.Options.Add(Models); + command.Options.Add(Model); + command.Options.Add(Messages); + command.Options.Add(Stream); + command.Options.Add(Temperature); + command.Options.Add(TopP); + command.Options.Add(MinP); + command.Options.Add(TopK); + command.Options.Add(MaxTokens); + command.Options.Add(Stop); + command.Options.Add(StopTokenIds); + command.Options.Add(N); + command.Options.Add(PresencePenalty); + command.Options.Add(FrequencyPenalty); + command.Options.Add(Tools); + command.Options.Add(ToolChoice); + command.Options.Add(ResponseFormat); + command.Options.Add(RepetitionPenalty); + command.Options.Add(User); + command.Options.Add(Seed); + command.Options.Add(Logprobs); + command.Options.Add(ReasoningEffort); + command.Options.Add(Reasoning); + command.Options.Add(PromptCacheKey); + command.Options.Add(PromptCacheOptions); + command.Options.Add(ChatTemplateKwargs); + command.Options.Add(ContinueFinalMessage); + command.Options.Add(IgnoreEos); command.Options.Add(StreamOptionsOptions.IncludeUsage); + command.Options.Add(StreamOptionsOptions.ContinuousUsageStats); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + var failFast = CliRuntime.WasSpecified(parseResult, FailFast) ? parseResult.GetValue(FailFast) : (__requestBase is { } __FailFastBaseValue ? __FailFastBaseValue.FailFast : default); + var models = CliRuntime.WasSpecified(parseResult, Models) ? parseResult.GetValue(Models) : (__requestBase is { } __ModelsBaseValue ? __ModelsBaseValue.Models : default); + var model = parseResult.GetRequiredValue(Model); + var messages = parseResult.GetRequiredValue(Messages); + var stream = CliRuntime.WasSpecified(parseResult, Stream) ? parseResult.GetValue(Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); + var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); + var topP = CliRuntime.WasSpecified(parseResult, TopP) ? parseResult.GetValue(TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); + var minP = CliRuntime.WasSpecified(parseResult, MinP) ? parseResult.GetValue(MinP) : (__requestBase is { } __MinPBaseValue ? __MinPBaseValue.MinP : default); + var topK = CliRuntime.WasSpecified(parseResult, TopK) ? parseResult.GetValue(TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); + var maxTokens = CliRuntime.WasSpecified(parseResult, MaxTokens) ? parseResult.GetValue(MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); + var stop = CliRuntime.WasSpecified(parseResult, Stop) ? parseResult.GetValue(Stop) : (__requestBase is { } __StopBaseValue ? __StopBaseValue.Stop : default); + var stopTokenIds = CliRuntime.WasSpecified(parseResult, StopTokenIds) ? parseResult.GetValue(StopTokenIds) : (__requestBase is { } __StopTokenIdsBaseValue ? __StopTokenIdsBaseValue.StopTokenIds : default); + var n = CliRuntime.WasSpecified(parseResult, N) ? parseResult.GetValue(N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); + var presencePenalty = CliRuntime.WasSpecified(parseResult, PresencePenalty) ? parseResult.GetValue(PresencePenalty) : (__requestBase is { } __PresencePenaltyBaseValue ? __PresencePenaltyBaseValue.PresencePenalty : default); + var frequencyPenalty = CliRuntime.WasSpecified(parseResult, FrequencyPenalty) ? parseResult.GetValue(FrequencyPenalty) : (__requestBase is { } __FrequencyPenaltyBaseValue ? __FrequencyPenaltyBaseValue.FrequencyPenalty : default); + var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); + var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); + var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); + var repetitionPenalty = CliRuntime.WasSpecified(parseResult, RepetitionPenalty) ? parseResult.GetValue(RepetitionPenalty) : (__requestBase is { } __RepetitionPenaltyBaseValue ? __RepetitionPenaltyBaseValue.RepetitionPenalty : default); + var user = CliRuntime.WasSpecified(parseResult, User) ? parseResult.GetValue(User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); + var seed = CliRuntime.WasSpecified(parseResult, Seed) ? parseResult.GetValue(Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); + var logprobs = CliRuntime.WasSpecified(parseResult, Logprobs) ? parseResult.GetValue(Logprobs) : (__requestBase is { } __LogprobsBaseValue ? __LogprobsBaseValue.Logprobs : default); + var reasoningEffort = CliRuntime.WasSpecified(parseResult, ReasoningEffort) ? parseResult.GetValue(ReasoningEffort) : (__requestBase is { } __ReasoningEffortBaseValue ? __ReasoningEffortBaseValue.ReasoningEffort : default); + var reasoning = CliRuntime.WasSpecified(parseResult, Reasoning) ? parseResult.GetValue(Reasoning) : (__requestBase is { } __ReasoningBaseValue ? __ReasoningBaseValue.Reasoning : default); + var promptCacheKey = CliRuntime.WasSpecified(parseResult, PromptCacheKey) ? parseResult.GetValue(PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); + var promptCacheOptions = CliRuntime.WasSpecified(parseResult, PromptCacheOptions) ? parseResult.GetValue(PromptCacheOptions) : (__requestBase is { } __PromptCacheOptionsBaseValue ? __PromptCacheOptionsBaseValue.PromptCacheOptions : default); + var chatTemplateKwargs = CliRuntime.WasSpecified(parseResult, ChatTemplateKwargs) ? parseResult.GetValue(ChatTemplateKwargs) : (__requestBase is { } __ChatTemplateKwargsBaseValue ? __ChatTemplateKwargsBaseValue.ChatTemplateKwargs : default); + var continueFinalMessage = CliRuntime.WasSpecified(parseResult, ContinueFinalMessage) ? parseResult.GetValue(ContinueFinalMessage) : (__requestBase is { } __ContinueFinalMessageBaseValue ? __ContinueFinalMessageBaseValue.ContinueFinalMessage : default); + var ignoreEos = CliRuntime.WasSpecified(parseResult, IgnoreEos) ? parseResult.GetValue(IgnoreEos) : (__requestBase is { } __IgnoreEosBaseValue ? __IgnoreEosBaseValue.IgnoreEos : default); + + var __StreamOptionsBase = __requestBase is { } __StreamOptionsBaseValue ? __StreamOptionsBaseValue.StreamOptions : default; var streamOptionsIncludeUsage = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) ? parseResult.GetValue(StreamOptionsOptions.IncludeUsage) : (__StreamOptionsBase is { } __StreamOptionsincludeUsageBaseValue ? __StreamOptionsincludeUsageBaseValue.IncludeUsage : default); + var streamOptionsContinuousUsageStats = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats) ? parseResult.GetValue(StreamOptionsOptions.ContinuousUsageStats) : (__StreamOptionsBase is { } __StreamOptionscontinuousUsageStatsBaseValue ? __StreamOptionscontinuousUsageStatsBaseValue.ContinuousUsageStats : default); + var __StreamOptionsSpecified = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) || CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats); + var streamOptions = + __StreamOptionsSpecified || __StreamOptionsBase is not null + ? new global::DeepInfra.StreamOptions + { + IncludeUsage = streamOptionsIncludeUsage, + ContinuousUsageStats = streamOptionsContinuousUsageStats, + + } + : __StreamOptionsBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ChatCompletions.OpenaiChatCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + serviceTier: serviceTier, + failFast: failFast, + models: models, + 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, + reasoningEffort: reasoningEffort, + reasoning: reasoning, + promptCacheKey: promptCacheKey, + promptCacheOptions: promptCacheOptions, + chatTemplateKwargs: chatTemplateKwargs, + continueFinalMessage: continueFinalMessage, + ignoreEos: ignoreEos, + streamOptions: streamOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ChatReasoningSettingsOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/ChatReasoningSettingsOptionSet.g.cs deleted file mode 100644 index 47e24716..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ChatReasoningSettingsOptionSet.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record ChatReasoningSettingsOptionSet( - Option Enabled) -{ - public static ChatReasoningSettingsOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new ChatReasoningSettingsOptionSet( - Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"Enable or disable reasoning with default parameters.") - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CliVersionCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CliVersionCommandApiCommand.g.cs deleted file mode 100644 index 50f316db..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CliVersionCommandApiCommand.g.cs +++ /dev/null @@ -1,64 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CliVersionCommandApiCommand -{ - private static Option Version { get; } = new( - name: @"--version") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"cli-version", @"Cli Version"); - command.Options.Add(Version); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var version = parseResult.GetRequiredValue(Version); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CliVersionAsync( - version: version, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CompletionMultiModalDataOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/CompletionMultiModalDataOptionSet.g.cs deleted file mode 100644 index 4d33334b..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CompletionMultiModalDataOptionSet.g.cs +++ /dev/null @@ -1,22 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record CompletionMultiModalDataOptionSet( - Option?> Image) -{ - public static CompletionMultiModalDataOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new CompletionMultiModalDataOptionSet( - Image: new Option?>($"--{normalizedPrefix}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.", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ContainerRentalsDeleteCommandApiCommand.g.cs deleted file mode 100644 index 26e9c902..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsDeleteCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ContainerRentalsDeleteCommandApiCommand -{ - private static Argument ContainerId { get; } = new( - name: @"container-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"container-rentals-delete", @"Container Rentals Delete"); - command.Arguments.Add(ContainerId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var containerId = parseResult.GetRequiredValue(ContainerId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ContainerRentalsDeleteAsync( - containerId: containerId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsGetCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ContainerRentalsGetCommandApiCommand.g.cs deleted file mode 100644 index a2e825b9..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsGetCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ContainerRentalsGetCommandApiCommand -{ - private static Argument ContainerId { get; } = new( - name: @"container-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ContainerRentalOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ContainerRentalOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"container-rentals-get", @"Container Rentals Get"); - command.Arguments.Add(ContainerId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var containerId = parseResult.GetRequiredValue(ContainerId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ContainerRentalsGetAsync( - containerId: containerId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsGetParamsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ContainerRentalsGetParamsCommandApiCommand.g.cs deleted file mode 100644 index 01929432..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsGetParamsCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ContainerRentalsGetParamsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"container-rentals-get-params", @"Container Rentals Get Params"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ContainerRentalsGetParamsAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ContainerRentalsListCommandApiCommand.g.cs deleted file mode 100644 index df9b6070..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsListCommandApiCommand.g.cs +++ /dev/null @@ -1,80 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ContainerRentalsListCommandApiCommand -{ - private static Option State { get; } = new( - name: @"--state") - { - Description = @"whether to return active or inactive containers", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"container-rentals-list", @"Container Rentals List"); - command.Options.Add(State); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var state = parseResult.GetValue(State); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ContainerRentalsListAsync( - state: state, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsStartCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ContainerRentalsStartCommandApiCommand.g.cs deleted file mode 100644 index 71c827d6..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsStartCommandApiCommand.g.cs +++ /dev/null @@ -1,102 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ContainerRentalsStartCommandApiCommand -{ - private static Argument NameOption { get; } = new( - name: @"name") - { - Description = @"Container Name", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option GpuConfig { get; } = new( - name: @"--gpu-config") - { - Description = @"GPU config", - Required = true, - }; - - private static Option ContainerImage { get; } = new( - name: @"--container-image") - { - Description = @"Container Image", - Required = true, - }; - - private static Option CloudInitUserData { get; } = new( - name: @"--cloud-init-user-data") - { - Description = @"Cloud Init User Data", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ContainerRentalStartOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ContainerRentalStartOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"container-rentals-start", @"Container Rentals Start"); - command.Arguments.Add(NameOption); - command.Options.Add(XiApiKey); - command.Options.Add(GpuConfig); - command.Options.Add(ContainerImage); - command.Options.Add(CloudInitUserData); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var name = parseResult.GetRequiredValue(NameOption); - var xiApiKey = parseResult.GetValue(XiApiKey); - var gpuConfig = parseResult.GetRequiredValue(GpuConfig); - var containerImage = parseResult.GetRequiredValue(ContainerImage); - var cloudInitUserData = parseResult.GetRequiredValue(CloudInitUserData); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ContainerRentalsStartAsync( - name: name, - xiApiKey: xiApiKey, - gpuConfig: gpuConfig, - containerImage: containerImage, - cloudInitUserData: cloudInitUserData, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ContainerRentalsUpdateCommandApiCommand.g.cs deleted file mode 100644 index 7a650cdb..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ContainerRentalsUpdateCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ContainerRentalsUpdateCommandApiCommand -{ - private static Argument ContainerId { get; } = new( - name: @"container-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option NameOption { get; } = new( - name: @"--name") - { - Description = @"Container Name", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"container-rentals-update", @"Container Rentals Update"); - command.Arguments.Add(ContainerId); - command.Options.Add(XiApiKey); - command.Options.Add(NameOption); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var containerId = parseResult.GetRequiredValue(ContainerId); - var xiApiKey = parseResult.GetValue(XiApiKey); - var name = parseResult.GetRequiredValue(NameOption); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ContainerRentalsUpdateAsync( - containerId: containerId, - xiApiKey: xiApiKey, - name: name, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateApiTokenCommandApiCommand.g.cs deleted file mode 100644 index 1c9989dc..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateApiTokenCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateApiTokenCommandApiCommand -{ - private static Argument NameOption { get; } = new( - name: @"name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ApiToken value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ApiToken value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-api-token", @"Create Api Token"); - command.Arguments.Add(NameOption); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var name = parseResult.GetRequiredValue(NameOption); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateApiTokenAsync( - name: name, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateLoraCommandApiCommand.g.cs deleted file mode 100644 index e46c59c2..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateLoraCommandApiCommand.g.cs +++ /dev/null @@ -1,148 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateLoraCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option BaseModel { get; } = new( - name: @"--base-model") - { - Description = @"", - Required = true, - }; - - private static Option LoraName { get; } = new( - name: @"--lora-name") - { - Description = @"", - Required = true, - }; - - private static Option Source { get; } = new( - name: @"--source") - { - Description = @"", - Required = true, - }; - - private static Option Private { get; } = new( - name: @"--private") - { - Description = @"", - Required = true, - }; - - private static Option DescriptionOption { get; } = new( - name: @"--description") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-lora", @"Create Lora"); - command.Options.Add(XiApiKey); - command.Options.Add(BaseModel); - command.Options.Add(LoraName); - command.Options.Add(Source); - command.Options.Add(Private); - command.Options.Add(DescriptionOption); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var baseModel = parseResult.GetRequiredValue(BaseModel); - var loraName = parseResult.GetRequiredValue(LoraName); - var source = parseResult.GetRequiredValue(Source); - var @private = parseResult.GetRequiredValue(Private); - var description = CliRuntime.WasSpecified(parseResult, DescriptionOption) ? parseResult.GetValue(DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateLoraAsync( - xiApiKey: xiApiKey, - baseModel: baseModel, - loraName: loraName, - source: source, - @private: @private, - description: description, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateOpenaiBatch2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateOpenaiBatch2CommandApiCommand.g.cs deleted file mode 100644 index b72bdfeb..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateOpenaiBatch2CommandApiCommand.g.cs +++ /dev/null @@ -1,116 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateOpenaiBatch2CommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Metadata { get; } = new( - name: @"--metadata") - { - Description = @"Optional metadata to be stored with the batch.", - }; - private static readonly OpenAIBatchesInOptionSet OpenAIBatchesInOptionSetOptions = OpenAIBatchesInOptionSet.Create(); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIBatch value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIBatch value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-openai-batch2", @"Create Openai Batch"); - command.Options.Add(XiApiKey); - command.Options.Add(Metadata); command.Options.Add(OpenAIBatchesInOptionSetOptions.InputFileId); - command.Options.Add(OpenAIBatchesInOptionSetOptions.Endpoint); - command.Options.Add(OpenAIBatchesInOptionSetOptions.CompletionWindow); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default); var inputFileId = parseResult.GetRequiredValue(OpenAIBatchesInOptionSetOptions.InputFileId); - var endpoint = parseResult.GetRequiredValue(OpenAIBatchesInOptionSetOptions.Endpoint); - var completionWindow = parseResult.GetRequiredValue(OpenAIBatchesInOptionSetOptions.CompletionWindow); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateOpenaiBatch2Async( - xiApiKey: xiApiKey, - metadata: metadata, - inputFileId: inputFileId, - endpoint: endpoint, - completionWindow: completionWindow, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateOpenaiBatchCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateOpenaiBatchCommandApiCommand.g.cs deleted file mode 100644 index cc4b5d32..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateOpenaiBatchCommandApiCommand.g.cs +++ /dev/null @@ -1,116 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateOpenaiBatchCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Metadata { get; } = new( - name: @"--metadata") - { - Description = @"Optional metadata to be stored with the batch.", - }; - private static readonly OpenAIBatchesInOptionSet OpenAIBatchesInOptionSetOptions = OpenAIBatchesInOptionSet.Create(); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIBatch value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIBatch value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-openai-batch", @"Create Openai Batch"); - command.Options.Add(XiApiKey); - command.Options.Add(Metadata); command.Options.Add(OpenAIBatchesInOptionSetOptions.InputFileId); - command.Options.Add(OpenAIBatchesInOptionSetOptions.Endpoint); - command.Options.Add(OpenAIBatchesInOptionSetOptions.CompletionWindow); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default); var inputFileId = parseResult.GetRequiredValue(OpenAIBatchesInOptionSetOptions.InputFileId); - var endpoint = parseResult.GetRequiredValue(OpenAIBatchesInOptionSetOptions.Endpoint); - var completionWindow = parseResult.GetRequiredValue(OpenAIBatchesInOptionSetOptions.CompletionWindow); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateOpenaiBatchAsync( - xiApiKey: xiApiKey, - metadata: metadata, - inputFileId: inputFileId, - endpoint: endpoint, - completionWindow: completionWindow, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateScopedJwtCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateScopedJwtCommandApiCommand.g.cs deleted file mode 100644 index bb8b1cdf..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateScopedJwtCommandApiCommand.g.cs +++ /dev/null @@ -1,145 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateScopedJwtCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ApiKeyName { get; } = new( - name: @"--api-key-name") - { - Description = @"", - Required = true, - }; - - private static Option?> Models { get; } = new( - name: @"--models") - { - Description = @"allow inference only to the specified model names", - }; - - private static Option ExpiresDelta { get; } = new( - name: @"--expires-delta") - { - Description = @"how many seconds in the future should the token be valid for", - }; - - private static Option ExpiresAt { get; } = new( - name: @"--expires-at") - { - Description = @"unix timestamp when the token should expire", - }; - - private static Option SpendingLimit { get; } = new( - name: @"--spending-limit") - { - Description = @"only allow spending that much USD until the token becomes invalid", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ScopedJWTOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ScopedJWTOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-scoped-jwt", @" Create Scoped Jwt"); - command.Options.Add(XiApiKey); - command.Options.Add(ApiKeyName); - command.Options.Add(Models); - command.Options.Add(ExpiresDelta); - command.Options.Add(ExpiresAt); - command.Options.Add(SpendingLimit); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var apiKeyName = parseResult.GetRequiredValue(ApiKeyName); - var models = CliRuntime.WasSpecified(parseResult, Models) ? parseResult.GetValue(Models) : (__requestBase is { } __ModelsBaseValue ? __ModelsBaseValue.Models : default); - var expiresDelta = CliRuntime.WasSpecified(parseResult, ExpiresDelta) ? parseResult.GetValue(ExpiresDelta) : (__requestBase is { } __ExpiresDeltaBaseValue ? __ExpiresDeltaBaseValue.ExpiresDelta : default); - var expiresAt = CliRuntime.WasSpecified(parseResult, ExpiresAt) ? parseResult.GetValue(ExpiresAt) : (__requestBase is { } __ExpiresAtBaseValue ? __ExpiresAtBaseValue.ExpiresAt : default); - var spendingLimit = CliRuntime.WasSpecified(parseResult, SpendingLimit) ? parseResult.GetValue(SpendingLimit) : (__requestBase is { } __SpendingLimitBaseValue ? __SpendingLimitBaseValue.SpendingLimit : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateScopedJwtAsync( - xiApiKey: xiApiKey, - apiKeyName: apiKeyName, - models: models, - expiresDelta: expiresDelta, - expiresAt: expiresAt, - spendingLimit: spendingLimit, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateSshKeyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateSshKeyCommandApiCommand.g.cs deleted file mode 100644 index c0d32fe8..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateSshKeyCommandApiCommand.g.cs +++ /dev/null @@ -1,83 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateSshKeyCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option NameOption { get; } = new( - name: @"--name") - { - Description = @"SSH Key name", - Required = true, - }; - - private static Option Key { get; } = new( - name: @"--key") - { - Description = @"SSH Key content", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.SshKeyOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.SshKeyOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-ssh-key", @"Create Ssh Key"); - command.Options.Add(XiApiKey); - command.Options.Add(NameOption); - command.Options.Add(Key); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - var name = parseResult.GetRequiredValue(NameOption); - var key = parseResult.GetRequiredValue(Key); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateSshKeyAsync( - xiApiKey: xiApiKey, - name: name, - key: key, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/CreateVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/CreateVoiceCommandApiCommand.g.cs deleted file mode 100644 index 3c2d485f..00000000 --- a/src/cli/DeepInfra.CLI/Commands/CreateVoiceCommandApiCommand.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class CreateVoiceCommandApiCommand -{ - private static Argument NameOption { get; } = new( - name: @"name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option DescriptionOption { get; } = new( - name: @"--description") - { - Description = @"", - Required = true, - }; - - private static Option> Files { get; } = new( - name: @"--files") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Voice value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Voice value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"create-voice", @"Create Voice -Create a new voice"); - command.Arguments.Add(NameOption); - command.Options.Add(XiApiKey); - command.Options.Add(DescriptionOption); - command.Options.Add(Files); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var name = parseResult.GetRequiredValue(NameOption); - var xiApiKey = parseResult.GetValue(XiApiKey); - var description = parseResult.GetRequiredValue(DescriptionOption); - var files = parseResult.GetRequiredValue(Files); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.CreateVoiceAsync( - name: name, - xiApiKey: xiApiKey, - description: description, - files: files, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsApiGroupCommand.g.cs new file mode 100644 index 00000000..d42c66c4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsApiGroupCommand.g.cs @@ -0,0 +1,35 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class DedicatedModelsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"dedicated-models", @"Dedicated Models endpoint commands."); + command.Subcommands.Add(DedicatedModelsDeployArgsHistoryCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployArgsRestoreCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployCreateCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployCreateHfCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployCreateLlmCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployDeleteCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployDetailedStatsCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployGpuAvailabilityCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployList2CommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployLlmPresetsCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployLlmStandardArgsCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployLlmSuggestNameCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployRebalanceCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployRebalanceCancelCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployRebalanceStatusCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployStartCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployStatsCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployStatusCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployStopCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeployUpdateCommandApiCommand.Create()); + command.Subcommands.Add(DedicatedModelsDeploymentStatsCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployArgsHistoryCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployArgsHistoryCommandApiCommand.g.cs new file mode 100644 index 00000000..d62353e1 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployArgsHistoryCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployArgsHistoryCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-args-history", @"Deploy Args History"); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployArgsHistoryAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployArgsRestoreCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployArgsRestoreCommandApiCommand.g.cs new file mode 100644 index 00000000..c07637bd --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployArgsRestoreCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployArgsRestoreCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Argument EntryId { get; } = new( + name: @"entry-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-args-restore", @"Deploy Args Restore"); + command.Arguments.Add(DeployId); + command.Arguments.Add(EntryId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var entryId = parseResult.GetRequiredValue(EntryId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployArgsRestoreAsync( + deployId: deployId, + entryId: entryId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateCommandApiCommand.g.cs new file mode 100644 index 00000000..5fbb8598 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateCommandApiCommand.g.cs @@ -0,0 +1,136 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployCreateCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Provider { get; } = new( + name: @"--provider") + { + Description = @"namespace for the model name", + }; + + private static Option ModelName { get; } = new( + name: @"--model-name") + { + Description = @"model name in specified provider", + Required = true, + }; + + private static Option Version { get; } = new( + name: @"--version") + { + Description = @"A specific revision, if left empty uses the last one", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployResult value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployResult value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-create", @"Deploy Create"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Provider); + command.Options.Add(ModelName); + command.Options.Add(Version); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var provider = CliRuntime.WasSpecified(parseResult, Provider) ? parseResult.GetValue(Provider) : (__requestBase is { } __ProviderBaseValue ? __ProviderBaseValue.Provider : default); + var modelName = parseResult.GetRequiredValue(ModelName); + var version = CliRuntime.WasSpecified(parseResult, Version) ? parseResult.GetValue(Version) : (__requestBase is { } __VersionBaseValue ? __VersionBaseValue.Version : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployCreateAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + provider: provider, + modelName: modelName, + version: version, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateHfCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateHfCommandApiCommand.g.cs new file mode 100644 index 00000000..465e2185 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateHfCommandApiCommand.g.cs @@ -0,0 +1,127 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployCreateHfCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ModelName { get; } = new( + name: @"--model-name") + { + Description = @"Model Id from huggingface", + Required = true, + }; + + private static Option Task { get; } = new( + name: @"--task") + { + Description = @"Task", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployResult value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployResult value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-create-hf", @"Deploy Create Hf"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ModelName); + command.Options.Add(Task); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var modelName = parseResult.GetRequiredValue(ModelName); + var task = CliRuntime.WasSpecified(parseResult, Task) ? parseResult.GetValue(Task) : (__requestBase is { } __TaskBaseValue ? __TaskBaseValue.Task : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployCreateHfAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + modelName: modelName, + task: task, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateLlmCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateLlmCommandApiCommand.g.cs new file mode 100644 index 00000000..c7a75781 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateLlmCommandApiCommand.g.cs @@ -0,0 +1,224 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployCreateLlmCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ModelName { get; } = new( + name: @"--model-name") + { + Description = @"model name for deepinfra (username/mode-name format)", + Required = true, + }; + + private static Option Gpu { get; } = new( + name: @"--gpu") + { + Description = @"The type of GPU the deployment is running on.", + Required = true, + }; + + private static Option NumGpus { get; } = new( + name: @"--num-gpus") + { + Description = @"Number of GPUs used by one instance", + }; + + private static Option Hf { get; } = new( + name: @"--hf") + { + Description = @"", + }; + + private static Option BaseModel { get; } = new( + name: @"--base-model") + { + Description = @"Base public model", + }; + + private static Option ContainerImage { get; } = new( + name: @"--container-image") + { + Description = @"Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4)", + }; + + private static Option?> ExtraArgs { get; } = new( + name: @"--extra-args") + { + Description = @"Extra command line arguments for custom deployments", + }; + + private static Option PresetId { get; } = new( + name: @"--preset-id") + { + Description = @"Apply a stored preset or vLLM recipe by id. A non-empty standard_args or extra_args in this request replaces the preset's whole matching field.", + }; + private static readonly ScaleSettingsOptionSet SettingsOptions = ScaleSettingsOptionSet.Create(@"settings"); + + private static readonly StandardArgsOptionSet StandardArgsOptions = StandardArgsOptionSet.Create(@"standard-args"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-create-llm", @"Deploy Create Llm"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ModelName); + command.Options.Add(Gpu); + command.Options.Add(NumGpus); + command.Options.Add(Hf); + command.Options.Add(BaseModel); + command.Options.Add(ContainerImage); + command.Options.Add(ExtraArgs); + command.Options.Add(PresetId); command.Options.Add(SettingsOptions.MinInstances); + command.Options.Add(SettingsOptions.MaxInstances); command.Options.Add(StandardArgsOptions.MaxContextSize); + command.Options.Add(StandardArgsOptions.MaxConcurrentRequests); + command.Options.Add(StandardArgsOptions.GpuMemoryFraction); + command.Options.Add(StandardArgsOptions.MaxPrefillTokens); + command.Options.Add(StandardArgsOptions.EnablePrefixCaching); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var modelName = parseResult.GetRequiredValue(ModelName); + var gpu = parseResult.GetRequiredValue(Gpu); + var numGpus = CliRuntime.WasSpecified(parseResult, NumGpus) ? parseResult.GetValue(NumGpus) : (__requestBase is { } __NumGpusBaseValue ? __NumGpusBaseValue.NumGpus : default); + var hf = CliRuntime.WasSpecified(parseResult, Hf) ? parseResult.GetValue(Hf) : (__requestBase is { } __HfBaseValue ? __HfBaseValue.Hf : default); + var baseModel = CliRuntime.WasSpecified(parseResult, BaseModel) ? parseResult.GetValue(BaseModel) : (__requestBase is { } __BaseModelBaseValue ? __BaseModelBaseValue.BaseModel : default); + var containerImage = CliRuntime.WasSpecified(parseResult, ContainerImage) ? parseResult.GetValue(ContainerImage) : (__requestBase is { } __ContainerImageBaseValue ? __ContainerImageBaseValue.ContainerImage : default); + var extraArgs = CliRuntime.WasSpecified(parseResult, ExtraArgs) ? parseResult.GetValue(ExtraArgs) : (__requestBase is { } __ExtraArgsBaseValue ? __ExtraArgsBaseValue.ExtraArgs : default); + var presetId = CliRuntime.WasSpecified(parseResult, PresetId) ? parseResult.GetValue(PresetId) : (__requestBase is { } __PresetIdBaseValue ? __PresetIdBaseValue.PresetId : default); + + var __SettingsBase = __requestBase is { } __SettingsBaseValue ? __SettingsBaseValue.Settings : default; var settingsMinInstances = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) ? parseResult.GetValue(SettingsOptions.MinInstances) : (__SettingsBase is { } __SettingsminInstancesBaseValue ? __SettingsminInstancesBaseValue.MinInstances : default); + var settingsMaxInstances = CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances) ? parseResult.GetValue(SettingsOptions.MaxInstances) : (__SettingsBase is { } __SettingsmaxInstancesBaseValue ? __SettingsmaxInstancesBaseValue.MaxInstances : default); + var __SettingsSpecified = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) || CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances); + var settings = + __SettingsSpecified || __SettingsBase is not null + ? new global::DeepInfra.ScaleSettings + { + MinInstances = settingsMinInstances, + MaxInstances = settingsMaxInstances, + + } + : __SettingsBase; + + var __StandardArgsBase = __requestBase is { } __StandardArgsBaseValue ? __StandardArgsBaseValue.StandardArgs : default; var standardArgsMaxContextSize = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxContextSize) ? parseResult.GetValue(StandardArgsOptions.MaxContextSize) : (__StandardArgsBase is { } __StandardArgsmaxContextSizeBaseValue ? __StandardArgsmaxContextSizeBaseValue.MaxContextSize : default); + var standardArgsMaxConcurrentRequests = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxConcurrentRequests) ? parseResult.GetValue(StandardArgsOptions.MaxConcurrentRequests) : (__StandardArgsBase is { } __StandardArgsmaxConcurrentRequestsBaseValue ? __StandardArgsmaxConcurrentRequestsBaseValue.MaxConcurrentRequests : default); + var standardArgsGpuMemoryFraction = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.GpuMemoryFraction) ? parseResult.GetValue(StandardArgsOptions.GpuMemoryFraction) : (__StandardArgsBase is { } __StandardArgsgpuMemoryFractionBaseValue ? __StandardArgsgpuMemoryFractionBaseValue.GpuMemoryFraction : default); + var standardArgsMaxPrefillTokens = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxPrefillTokens) ? parseResult.GetValue(StandardArgsOptions.MaxPrefillTokens) : (__StandardArgsBase is { } __StandardArgsmaxPrefillTokensBaseValue ? __StandardArgsmaxPrefillTokensBaseValue.MaxPrefillTokens : default); + var standardArgsEnablePrefixCaching = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.EnablePrefixCaching) ? parseResult.GetValue(StandardArgsOptions.EnablePrefixCaching) : (__StandardArgsBase is { } __StandardArgsenablePrefixCachingBaseValue ? __StandardArgsenablePrefixCachingBaseValue.EnablePrefixCaching : default); + var __StandardArgsSpecified = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxContextSize) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxConcurrentRequests) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.GpuMemoryFraction) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxPrefillTokens) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.EnablePrefixCaching); + var standardArgs = + __StandardArgsSpecified || __StandardArgsBase is not null + ? new global::DeepInfra.StandardArgs + { + MaxContextSize = standardArgsMaxContextSize, + MaxConcurrentRequests = standardArgsMaxConcurrentRequests, + GpuMemoryFraction = standardArgsGpuMemoryFraction, + MaxPrefillTokens = standardArgsMaxPrefillTokens, + EnablePrefixCaching = standardArgsEnablePrefixCaching, + + } + : __StandardArgsBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployCreateLlmAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + modelName: modelName, + gpu: gpu, + numGpus: numGpus, + hf: hf, + baseModel: baseModel, + containerImage: containerImage, + extraArgs: extraArgs, + presetId: presetId, + settings: settings, + standardArgs: standardArgs, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..cff2d93a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployDeleteCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployDeleteCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployDelete value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployDelete value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-delete", @"Deploy Delete"); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployDeleteAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployDetailedStatsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployDetailedStatsCommandApiCommand.g.cs new file mode 100644 index 00000000..e115ea52 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployDetailedStatsCommandApiCommand.g.cs @@ -0,0 +1,100 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployDetailedStatsCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period, unix ts or 'now-5h', supported units s, m, h, d, w", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period, unix ts or now-relative, check from, defaults to now", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DetailedDeploymentStatsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DetailedDeploymentStatsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-detailed-stats", @"Deploy Detailed Stats"); + command.Arguments.Add(DeployId); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployDetailedStatsAsync( + deployId: deployId, + from: from, + to: to, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployGpuAvailabilityCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployGpuAvailabilityCommandApiCommand.g.cs new file mode 100644 index 00000000..c3e24d21 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployGpuAvailabilityCommandApiCommand.g.cs @@ -0,0 +1,98 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployGpuAvailabilityCommandApiCommand +{ + private static Option Source { get; } = new( + name: @"--source") + { + Description = @"", + }; + + private static Option BaseModel { get; } = new( + name: @"--base-model") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-gpu-availability", @"Deploy Gpu Availability"); + command.Options.Add(Source); + command.Options.Add(BaseModel); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var source = parseResult.GetValue(Source); + var baseModel = parseResult.GetValue(BaseModel); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployGpuAvailabilityAsync( + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Gpus", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployList2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployList2CommandApiCommand.g.cs new file mode 100644 index 00000000..166cc7d9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployList2CommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployList2CommandApiCommand +{ + private static Option Status { get; } = new( + name: @"--status") + { + Description = @"A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,updating,stopped,failed,deleted", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-list2", @"Deploy List"); + command.Options.Add(Status); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var status = parseResult.GetValue(Status); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployList2Async( + status: status, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmPresetsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmPresetsCommandApiCommand.g.cs new file mode 100644 index 00000000..b497aa1b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmPresetsCommandApiCommand.g.cs @@ -0,0 +1,119 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployLlmPresetsCommandApiCommand +{ + private static Option HfRepoId { get; } = new( + name: @"--hf-repo-id") + { + Description = @"", + Required = true, + }; + + private static Option Gpu { get; } = new( + name: @"--gpu") + { + Description = @"", + }; + + private static Option Engine { get; } = new( + name: @"--engine") + { + Description = @"", + }; + + private static Option Source { get; } = new( + name: @"--source") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-llm-presets", @"Deploy Llm Presets +DeepInfra presets and mirrored vLLM recipes for ``hf_repo_id``, told apart by +``source``; empty when none. Filter by ``gpu``/``engine``/``source``."); + command.Options.Add(HfRepoId); + command.Options.Add(Gpu); + command.Options.Add(Engine); + command.Options.Add(Source); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var hfRepoId = parseResult.GetRequiredValue(HfRepoId); + var gpu = parseResult.GetValue(Gpu); + var engine = parseResult.GetValue(Engine); + var source = parseResult.GetValue(Source); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployLlmPresetsAsync( + hfRepoId: hfRepoId, + gpu: gpu, + engine: engine, + source: source, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmStandardArgsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmStandardArgsCommandApiCommand.g.cs new file mode 100644 index 00000000..7114e5ea --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmStandardArgsCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployLlmStandardArgsCommandApiCommand +{ + private static Option Engine { get; } = new( + name: @"--engine") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-llm-standard-args", @"Deploy Llm Standard Args"); + command.Options.Add(Engine); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var engine = parseResult.GetValue(Engine); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployLlmStandardArgsAsync( + engine: engine, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmSuggestNameCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmSuggestNameCommandApiCommand.g.cs new file mode 100644 index 00000000..ddd20012 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmSuggestNameCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployLlmSuggestNameCommandApiCommand +{ + private static Option ModelName { get; } = new( + name: @"--model-name") + { + Description = @"", + Required = true, + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ModelNameSuggestionOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ModelNameSuggestionOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-llm-suggest-name", @"Deploy Llm Suggest Name"); + command.Options.Add(ModelName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployLlmSuggestNameAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceCancelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceCancelCommandApiCommand.g.cs new file mode 100644 index 00000000..68192f0c --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceCancelCommandApiCommand.g.cs @@ -0,0 +1,120 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployRebalanceCancelCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RebalanceCancelOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RebalanceCancelOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-rebalance-cancel", @"Deploy Rebalance Cancel +Stop an in-flight GPU pool rebalance; instances already moved stay, and +both deployments keep min/max instances fixed at their current counts."); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount != 1) + { + result.AddError(@"Specify exactly one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var request = await CliRuntime.ReadRequestAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployRebalanceCancelAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: request, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceCommandApiCommand.g.cs new file mode 100644 index 00000000..cb35d6a3 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceCommandApiCommand.g.cs @@ -0,0 +1,147 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployRebalanceCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option TargetDeployId { get; } = new( + name: @"--target-deploy-id") + { + Description = @"Deployment to grow using GPUs freed from this one.", + Required = true, + }; + + private static Option Count { get; } = new( + name: @"--count") + { + Description = @"Number of target instances to create.", + Required = true, + }; + + private static Option DryRun { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--dry-run", + description: @"Validate and preview without moving anything."); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RebalanceOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RebalanceOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-rebalance", @"Deploy Rebalance +Start a GPU pool rebalance: move GPUs from this deployment onto another +deployment you own, one instance at a time and without downtime. Moving all +instances stops this deployment; start it again later to resume it."); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(TargetDeployId); + command.Options.Add(Count); + command.Options.Add(DryRun); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var targetDeployId = parseResult.GetRequiredValue(TargetDeployId); + var count = parseResult.GetRequiredValue(Count); + var dryRun = CliRuntime.WasSpecified(parseResult, DryRun) ? parseResult.GetValue(DryRun) : (__requestBase is { } __DryRunBaseValue ? __DryRunBaseValue.DryRun : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployRebalanceAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + targetDeployId: targetDeployId, + count: count, + dryRun: dryRun, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceStatusCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..2cc128e1 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployRebalanceStatusCommandApiCommand.g.cs @@ -0,0 +1,93 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployRebalanceStatusCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RebalanceStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RebalanceStatusOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-rebalance-status", @"Deploy Rebalance Status +Status of GPU pool rebalances touching this deployment. A just-started +rebalance can take a moment to appear. A finished or cancelled rebalance +leaves both deployments' min/max instances fixed at the final counts; edit +them to resume autoscaling."); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployRebalanceStatusAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Recent", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStartCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStartCommandApiCommand.g.cs new file mode 100644 index 00000000..0c861331 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStartCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployStartCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-start", @"Deploy Start +Start a stopped deployment. Re-creates pods via auto-scaling."); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployStartAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStatsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStatsCommandApiCommand.g.cs new file mode 100644 index 00000000..0106a464 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStatsCommandApiCommand.g.cs @@ -0,0 +1,100 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployStatsCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period, unix ts or now-relative, check from, defaults to now", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentStatsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentStatsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-stats", @"Deploy Stats"); + command.Arguments.Add(DeployId); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployStatsAsync( + deployId: deployId, + from: from, + to: to, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStatusCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..a0c53c45 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStatusCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployStatusCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-status", @"Deploy Status"); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployStatusAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStopCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStopCommandApiCommand.g.cs new file mode 100644 index 00000000..016ba529 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployStopCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployStopCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-stop", @"Deploy Stop +Stop a running deployment. Terminates pods. Can be restarted later."); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployStopAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployUpdateCommandApiCommand.g.cs new file mode 100644 index 00000000..f383b01f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployUpdateCommandApiCommand.g.cs @@ -0,0 +1,168 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeployUpdateCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option?> ExtraArgs { get; } = new( + name: @"--extra-args") + { + Description = @"Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared.", + }; + private static readonly ScaleSettingsOptionSet SettingsOptions = ScaleSettingsOptionSet.Create(@"settings"); + + private static readonly StandardArgsOptionSet StandardArgsOptions = StandardArgsOptionSet.Create(@"standard-args"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy-update", @"Deploy Update"); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ExtraArgs); command.Options.Add(SettingsOptions.MinInstances); + command.Options.Add(SettingsOptions.MaxInstances); command.Options.Add(StandardArgsOptions.MaxContextSize); + command.Options.Add(StandardArgsOptions.MaxConcurrentRequests); + command.Options.Add(StandardArgsOptions.GpuMemoryFraction); + command.Options.Add(StandardArgsOptions.MaxPrefillTokens); + command.Options.Add(StandardArgsOptions.EnablePrefixCaching); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var extraArgs = CliRuntime.WasSpecified(parseResult, ExtraArgs) ? parseResult.GetValue(ExtraArgs) : (__requestBase is { } __ExtraArgsBaseValue ? __ExtraArgsBaseValue.ExtraArgs : default); + + var __SettingsBase = __requestBase is { } __SettingsBaseValue ? __SettingsBaseValue.Settings : default; var settingsMinInstances = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) ? parseResult.GetValue(SettingsOptions.MinInstances) : (__SettingsBase is { } __SettingsminInstancesBaseValue ? __SettingsminInstancesBaseValue.MinInstances : default); + var settingsMaxInstances = CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances) ? parseResult.GetValue(SettingsOptions.MaxInstances) : (__SettingsBase is { } __SettingsmaxInstancesBaseValue ? __SettingsmaxInstancesBaseValue.MaxInstances : default); + var __SettingsSpecified = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) || CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances); + var settings = + __SettingsSpecified || __SettingsBase is not null + ? new global::DeepInfra.ScaleSettings + { + MinInstances = settingsMinInstances, + MaxInstances = settingsMaxInstances, + + } + : __SettingsBase; + + var __StandardArgsBase = __requestBase is { } __StandardArgsBaseValue ? __StandardArgsBaseValue.StandardArgs : default; var standardArgsMaxContextSize = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxContextSize) ? parseResult.GetValue(StandardArgsOptions.MaxContextSize) : (__StandardArgsBase is { } __StandardArgsmaxContextSizeBaseValue ? __StandardArgsmaxContextSizeBaseValue.MaxContextSize : default); + var standardArgsMaxConcurrentRequests = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxConcurrentRequests) ? parseResult.GetValue(StandardArgsOptions.MaxConcurrentRequests) : (__StandardArgsBase is { } __StandardArgsmaxConcurrentRequestsBaseValue ? __StandardArgsmaxConcurrentRequestsBaseValue.MaxConcurrentRequests : default); + var standardArgsGpuMemoryFraction = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.GpuMemoryFraction) ? parseResult.GetValue(StandardArgsOptions.GpuMemoryFraction) : (__StandardArgsBase is { } __StandardArgsgpuMemoryFractionBaseValue ? __StandardArgsgpuMemoryFractionBaseValue.GpuMemoryFraction : default); + var standardArgsMaxPrefillTokens = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxPrefillTokens) ? parseResult.GetValue(StandardArgsOptions.MaxPrefillTokens) : (__StandardArgsBase is { } __StandardArgsmaxPrefillTokensBaseValue ? __StandardArgsmaxPrefillTokensBaseValue.MaxPrefillTokens : default); + var standardArgsEnablePrefixCaching = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.EnablePrefixCaching) ? parseResult.GetValue(StandardArgsOptions.EnablePrefixCaching) : (__StandardArgsBase is { } __StandardArgsenablePrefixCachingBaseValue ? __StandardArgsenablePrefixCachingBaseValue.EnablePrefixCaching : default); + var __StandardArgsSpecified = CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxContextSize) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxConcurrentRequests) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.GpuMemoryFraction) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.MaxPrefillTokens) || CliRuntime.WasSpecified(parseResult, StandardArgsOptions.EnablePrefixCaching); + var standardArgs = + __StandardArgsSpecified || __StandardArgsBase is not null + ? new global::DeepInfra.StandardArgs + { + MaxContextSize = standardArgsMaxContextSize, + MaxConcurrentRequests = standardArgsMaxConcurrentRequests, + GpuMemoryFraction = standardArgsGpuMemoryFraction, + MaxPrefillTokens = standardArgsMaxPrefillTokens, + EnablePrefixCaching = standardArgsEnablePrefixCaching, + + } + : __StandardArgsBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeployUpdateAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + extraArgs: extraArgs, + settings: settings, + standardArgs: standardArgs, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeploymentStatsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeploymentStatsCommandApiCommand.g.cs new file mode 100644 index 00000000..0384947e --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeploymentStatsCommandApiCommand.g.cs @@ -0,0 +1,99 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class DedicatedModelsDeploymentStatsCommandApiCommand +{ + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)", + Required = true, + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period, unix ts or now-relative, check from, defaults to now", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deployment-stats", @"Deployment Stats"); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var from = parseResult.GetRequiredValue(From); + var to = parseResult.GetValue(To); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.DedicatedModels.DeploymentStatsAsync( + from: from, + to: to, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeepstartApplyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeepstartApplyCommandApiCommand.g.cs deleted file mode 100644 index b6ae34e5..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeepstartApplyCommandApiCommand.g.cs +++ /dev/null @@ -1,194 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeepstartApplyCommandApiCommand -{ - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static Option Id { get; } = new( - name: @"--id") - { - Description = @"", - }; - - private static Option Uid { get; } = new( - name: @"--uid") - { - Description = @"", - }; - - private static Option Company { get; } = new( - name: @"--company") - { - Description = @"", - Required = true, - }; - - private static Option Ceo { get; } = new( - name: @"--ceo") - { - Description = @"", - Required = true, - }; - - private static Option Funding { get; } = new( - name: @"--funding") - { - Description = @"", - Required = true, - }; - - private static Option FoundedOn { get; } = new( - name: @"--founded-on") - { - Description = @"", - Required = true, - }; - - private static Option Website { get; } = new( - name: @"--website") - { - Description = @"", - Required = true, - }; - - private static Option CreatedAt { get; } = new( - name: @"--created-at") - { - Description = @"", - }; - - private static Option Status { get; } = new( - name: @"--status") - { - Description = @"", - }; - - private static Option Deal { get; } = new( - name: @"--deal") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeepStartApplicationOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeepStartApplicationOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deepstart-apply", @"Deepstart Apply"); - command.Options.Add(Session); - command.Options.Add(Id); - command.Options.Add(Uid); - command.Options.Add(Company); - command.Options.Add(Ceo); - command.Options.Add(Funding); - command.Options.Add(FoundedOn); - command.Options.Add(Website); - command.Options.Add(CreatedAt); - command.Options.Add(Status); - command.Options.Add(Deal); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var session = parseResult.GetValue(Session); - var id = CliRuntime.WasSpecified(parseResult, Id) ? parseResult.GetValue(Id) : (__requestBase is { } __IdBaseValue ? __IdBaseValue.Id : default); - var uid = CliRuntime.WasSpecified(parseResult, Uid) ? parseResult.GetValue(Uid) : (__requestBase is { } __UidBaseValue ? __UidBaseValue.Uid : default); - var company = parseResult.GetRequiredValue(Company); - var ceo = parseResult.GetRequiredValue(Ceo); - var funding = parseResult.GetRequiredValue(Funding); - var foundedOn = parseResult.GetRequiredValue(FoundedOn); - var website = parseResult.GetRequiredValue(Website); - var createdAt = CliRuntime.WasSpecified(parseResult, CreatedAt) ? parseResult.GetValue(CreatedAt) : (__requestBase is { } __CreatedAtBaseValue ? __CreatedAtBaseValue.CreatedAt : default); - var status = CliRuntime.WasSpecified(parseResult, Status) ? parseResult.GetValue(Status) : (__requestBase is { } __StatusBaseValue ? __StatusBaseValue.Status : default); - var deal = CliRuntime.WasSpecified(parseResult, Deal) ? parseResult.GetValue(Deal) : (__requestBase is { } __DealBaseValue ? __DealBaseValue.Deal : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeepstartApplyAsync( - session: session, - id: id, - uid: uid, - company: company, - ceo: ceo, - funding: funding, - foundedOn: foundedOn, - website: website, - createdAt: createdAt, - status: status, - deal: deal, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DefaultApiGroupCommand.g.cs deleted file mode 100644 index e9901e99..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DefaultApiGroupCommand.g.cs +++ /dev/null @@ -1,138 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static class DefaultApiGroupCommand -{ - public static Command Create() - { - var command = new Command(@"default", @"default endpoint commands."); - command.Subcommands.Add(AccountEmailValuesCommandApiCommand.Create()); - command.Subcommands.Add(AccountGpuLimitCommandApiCommand.Create()); - command.Subcommands.Add(AccountRateLimitCommandApiCommand.Create()); - command.Subcommands.Add(AccountUpdateDetailsCommandApiCommand.Create()); - command.Subcommands.Add(AddFundsCommandApiCommand.Create()); - command.Subcommands.Add(AnthropicMessagesCommandApiCommand.Create()); - command.Subcommands.Add(AnthropicMessagesCountTokensCommandApiCommand.Create()); - command.Subcommands.Add(BillingPortalCommandApiCommand.Create()); - command.Subcommands.Add(CliVersionCommandApiCommand.Create()); - command.Subcommands.Add(ContainerRentalsDeleteCommandApiCommand.Create()); - command.Subcommands.Add(ContainerRentalsGetCommandApiCommand.Create()); - command.Subcommands.Add(ContainerRentalsGetParamsCommandApiCommand.Create()); - command.Subcommands.Add(ContainerRentalsListCommandApiCommand.Create()); - command.Subcommands.Add(ContainerRentalsStartCommandApiCommand.Create()); - command.Subcommands.Add(ContainerRentalsUpdateCommandApiCommand.Create()); - command.Subcommands.Add(CreateApiTokenCommandApiCommand.Create()); - command.Subcommands.Add(CreateLoraCommandApiCommand.Create()); - command.Subcommands.Add(CreateOpenaiBatchCommandApiCommand.Create()); - command.Subcommands.Add(CreateOpenaiBatch2CommandApiCommand.Create()); - command.Subcommands.Add(CreateScopedJwtCommandApiCommand.Create()); - command.Subcommands.Add(CreateSshKeyCommandApiCommand.Create()); - command.Subcommands.Add(CreateVoiceCommandApiCommand.Create()); - command.Subcommands.Add(DeepstartApplyCommandApiCommand.Create()); - command.Subcommands.Add(DeleteAccountCommandApiCommand.Create()); - command.Subcommands.Add(DeleteApiTokenCommandApiCommand.Create()); - command.Subcommands.Add(DeleteLoraCommandApiCommand.Create()); - command.Subcommands.Add(DeleteLoraModelCommandApiCommand.Create()); - command.Subcommands.Add(DeleteSshKeyCommandApiCommand.Create()); - command.Subcommands.Add(DeleteVoiceCommandApiCommand.Create()); - command.Subcommands.Add(DeployCreateCommandApiCommand.Create()); - command.Subcommands.Add(DeployCreateHfCommandApiCommand.Create()); - command.Subcommands.Add(DeployCreateLlmCommandApiCommand.Create()); - command.Subcommands.Add(DeployDeleteCommandApiCommand.Create()); - command.Subcommands.Add(DeployDetailedStatsCommandApiCommand.Create()); - command.Subcommands.Add(DeployGpuAvailabilityCommandApiCommand.Create()); - command.Subcommands.Add(DeployList2CommandApiCommand.Create()); - command.Subcommands.Add(DeployStartCommandApiCommand.Create()); - command.Subcommands.Add(DeployStatsCommandApiCommand.Create()); - command.Subcommands.Add(DeployStatusCommandApiCommand.Create()); - command.Subcommands.Add(DeployStopCommandApiCommand.Create()); - command.Subcommands.Add(DeployUpdateCommandApiCommand.Create()); - command.Subcommands.Add(DeploymentLogsQueryCommandApiCommand.Create()); - command.Subcommands.Add(DeploymentStatsCommandApiCommand.Create()); - command.Subcommands.Add(ExportApiTokenToVercelCommandApiCommand.Create()); - command.Subcommands.Add(GetApiTokenCommandApiCommand.Create()); - command.Subcommands.Add(GetApiTokensCommandApiCommand.Create()); - command.Subcommands.Add(GetChecklistCommandApiCommand.Create()); - command.Subcommands.Add(GetConfigCommandApiCommand.Create()); - command.Subcommands.Add(GetHardwareCommandApiCommand.Create()); - command.Subcommands.Add(GetLiveMetricsCommandApiCommand.Create()); - command.Subcommands.Add(GetLoraCommandApiCommand.Create()); - command.Subcommands.Add(GetLoraStatusCommandApiCommand.Create()); - command.Subcommands.Add(GetModelLorasCommandApiCommand.Create()); - command.Subcommands.Add(GetRequestCostsCommandApiCommand.Create()); - command.Subcommands.Add(GetSshKeysCommandApiCommand.Create()); - command.Subcommands.Add(GetUserLorasCommandApiCommand.Create()); - command.Subcommands.Add(GetVoiceCommandApiCommand.Create()); - command.Subcommands.Add(GetVoicesCommandApiCommand.Create()); - command.Subcommands.Add(GithubCliLoginCommandApiCommand.Create()); - command.Subcommands.Add(GithubLoginCommandApiCommand.Create()); - command.Subcommands.Add(InferenceDeployCommandApiCommand.Create()); - command.Subcommands.Add(InferenceModelCommandApiCommand.Create()); - command.Subcommands.Add(InspectScopedJwtCommandApiCommand.Create()); - command.Subcommands.Add(ListFilesCommandApiCommand.Create()); - command.Subcommands.Add(ListFiles2CommandApiCommand.Create()); - command.Subcommands.Add(LogsQueryCommandApiCommand.Create()); - command.Subcommands.Add(MeCommandApiCommand.Create()); - command.Subcommands.Add(ModelDeleteCommandApiCommand.Create()); - command.Subcommands.Add(ModelFamiliesNamesCommandApiCommand.Create()); - command.Subcommands.Add(ModelFamilyCommandApiCommand.Create()); - command.Subcommands.Add(ModelMetaUpdateCommandApiCommand.Create()); - command.Subcommands.Add(ModelPublicityCommandApiCommand.Create()); - command.Subcommands.Add(ModelSchemaCommandApiCommand.Create()); - command.Subcommands.Add(ModelVersionsCommandApiCommand.Create()); - command.Subcommands.Add(ModelsDeploymentListCommandApiCommand.Create()); - command.Subcommands.Add(ModelsFeaturedCommandApiCommand.Create()); - command.Subcommands.Add(ModelsInfoCommandApiCommand.Create()); - command.Subcommands.Add(ModelsListCommandApiCommand.Create()); - command.Subcommands.Add(ModelsLoraListCommandApiCommand.Create()); - command.Subcommands.Add(OktaLoginCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiAudioSpeechCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiAudioSpeech2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiAudioTranscriptionsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiAudioTranscriptions2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiAudioTranslationsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiAudioTranslations2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiChatCompletionsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiChatCompletions2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiCompletionsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiCompletions2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiEmbeddingsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiEmbeddings2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiFilesCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiFiles2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiImagesEditsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiImagesEdits2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiImagesGenerationsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiImagesGenerations2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiImagesVariationsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiImagesVariations2CommandApiCommand.Create()); - command.Subcommands.Add(OpenaiModelsCommandApiCommand.Create()); - command.Subcommands.Add(OpenaiModels2CommandApiCommand.Create()); - command.Subcommands.Add(OpenrouterModelsCommandApiCommand.Create()); - command.Subcommands.Add(PrivateModelsListCommandApiCommand.Create()); - command.Subcommands.Add(RentGpuAvailabilityCommandApiCommand.Create()); - command.Subcommands.Add(RequestGpuLimitIncreaseCommandApiCommand.Create()); - command.Subcommands.Add(RequestRateLimitIncreaseCommandApiCommand.Create()); - command.Subcommands.Add(RetrieveOpenaiBatchCommandApiCommand.Create()); - command.Subcommands.Add(RetrieveOpenaiBatch2CommandApiCommand.Create()); - command.Subcommands.Add(RetrieveOpenaiBatchesCommandApiCommand.Create()); - command.Subcommands.Add(RetrieveOpenaiBatches2CommandApiCommand.Create()); - command.Subcommands.Add(SetConfigCommandApiCommand.Create()); - command.Subcommands.Add(SetupTopupCommandApiCommand.Create()); - command.Subcommands.Add(SubmitFeedbackCommandApiCommand.Create()); - command.Subcommands.Add(TeamSetDisplayNameCommandApiCommand.Create()); - command.Subcommands.Add(TextToSpeechCommandApiCommand.Create()); - command.Subcommands.Add(TextToSpeechStreamCommandApiCommand.Create()); - command.Subcommands.Add(UpdateLoraCommandApiCommand.Create()); - command.Subcommands.Add(UpdateVoiceCommandApiCommand.Create()); - command.Subcommands.Add(UploadLoraModelCommandApiCommand.Create()); - command.Subcommands.Add(UsageCommandApiCommand.Create()); - command.Subcommands.Add(UsageApiTokenCommandApiCommand.Create()); - command.Subcommands.Add(UsageRentCommandApiCommand.Create()); - command.Subcommands.Add(UsageTokensCommandApiCommand.Create()); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeleteAccountCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeleteAccountCommandApiCommand.g.cs deleted file mode 100644 index 1d677f2c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeleteAccountCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeleteAccountCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Me value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Me value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"delete-account", @"Delete Account"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteAccountAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeleteApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeleteApiTokenCommandApiCommand.g.cs deleted file mode 100644 index c111abb0..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeleteApiTokenCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeleteApiTokenCommandApiCommand -{ - private static Argument ApiToken { get; } = new( - name: @"api-token") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"delete-api-token", @"Delete Api Token"); - command.Arguments.Add(ApiToken); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var apiToken = parseResult.GetRequiredValue(ApiToken); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteApiTokenAsync( - apiToken: apiToken, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeleteLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeleteLoraCommandApiCommand.g.cs deleted file mode 100644 index 2b2aaa1d..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeleteLoraCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeleteLoraCommandApiCommand -{ - private static Argument LoraName { get; } = new( - name: @"lora-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"delete-lora", @"Delete Lora"); - command.Arguments.Add(LoraName); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var loraName = parseResult.GetRequiredValue(LoraName); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteLoraAsync( - loraName: loraName, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeleteLoraModelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeleteLoraModelCommandApiCommand.g.cs deleted file mode 100644 index c243b0a1..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeleteLoraModelCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeleteLoraModelCommandApiCommand -{ - private static Argument LoraModelName { get; } = new( - name: @"lora-model-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"delete-lora-model", @"Delete Lora Model"); - command.Arguments.Add(LoraModelName); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var loraModelName = parseResult.GetRequiredValue(LoraModelName); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteLoraModelAsync( - loraModelName: loraModelName, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeleteSshKeyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeleteSshKeyCommandApiCommand.g.cs deleted file mode 100644 index 60fea22f..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeleteSshKeyCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeleteSshKeyCommandApiCommand -{ - private static Argument SshKeyId { get; } = new( - name: @"ssh-key-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"delete-ssh-key", @"Delete Ssh Key"); - command.Arguments.Add(SshKeyId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var sshKeyId = parseResult.GetRequiredValue(SshKeyId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteSshKeyAsync( - sshKeyId: sshKeyId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeleteVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeleteVoiceCommandApiCommand.g.cs deleted file mode 100644 index 1a543022..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeleteVoiceCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeleteVoiceCommandApiCommand -{ - private static Argument VoiceId { get; } = new( - name: @"voice-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"delete-voice", @"Delete Voice"); - command.Arguments.Add(VoiceId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var voiceId = parseResult.GetRequiredValue(VoiceId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeleteVoiceAsync( - voiceId: voiceId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployCreateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployCreateCommandApiCommand.g.cs deleted file mode 100644 index 3dee726c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployCreateCommandApiCommand.g.cs +++ /dev/null @@ -1,127 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployCreateCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Provider { get; } = new( - name: @"--provider") - { - Description = @"namespace for the model name", - }; - - private static Option ModelName { get; } = new( - name: @"--model-name") - { - Description = @"model name in specified provider", - Required = true, - }; - - private static Option Version { get; } = new( - name: @"--version") - { - Description = @"A specific revision, if left empty uses the last one", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployResult value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployResult value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-create", @"Deploy Create"); - command.Options.Add(XiApiKey); - command.Options.Add(Provider); - command.Options.Add(ModelName); - command.Options.Add(Version); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var provider = CliRuntime.WasSpecified(parseResult, Provider) ? parseResult.GetValue(Provider) : (__requestBase is { } __ProviderBaseValue ? __ProviderBaseValue.Provider : default); - var modelName = parseResult.GetRequiredValue(ModelName); - var version = CliRuntime.WasSpecified(parseResult, Version) ? parseResult.GetValue(Version) : (__requestBase is { } __VersionBaseValue ? __VersionBaseValue.Version : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployCreateAsync( - xiApiKey: xiApiKey, - provider: provider, - modelName: modelName, - version: version, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployCreateHfCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployCreateHfCommandApiCommand.g.cs deleted file mode 100644 index 2ef24b17..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployCreateHfCommandApiCommand.g.cs +++ /dev/null @@ -1,118 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployCreateHfCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ModelName { get; } = new( - name: @"--model-name") - { - Description = @"Model Id from huggingface", - Required = true, - }; - - private static Option Task { get; } = new( - name: @"--task") - { - Description = @"Task", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployResult value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployResult value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-create-hf", @"Deploy Create Hf"); - command.Options.Add(XiApiKey); - command.Options.Add(ModelName); - command.Options.Add(Task); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var modelName = parseResult.GetRequiredValue(ModelName); - var task = CliRuntime.WasSpecified(parseResult, Task) ? parseResult.GetValue(Task) : (__requestBase is { } __TaskBaseValue ? __TaskBaseValue.Task : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployCreateHfAsync( - xiApiKey: xiApiKey, - modelName: modelName, - task: task, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployCreateLlmCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployCreateLlmCommandApiCommand.g.cs deleted file mode 100644 index 8addc2b8..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployCreateLlmCommandApiCommand.g.cs +++ /dev/null @@ -1,189 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployCreateLlmCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ModelName { get; } = new( - name: @"--model-name") - { - Description = @"model name for deepinfra (username/mode-name format)", - Required = true, - }; - - private static Option Gpu { get; } = new( - name: @"--gpu") - { - Description = @"The type of GPU the deployment is running on", - Required = true, - }; - - private static Option NumGpus { get; } = new( - name: @"--num-gpus") - { - Description = @"Number of GPUs used by one instance", - }; - - private static Option MaxBatchSize { get; } = new( - name: @"--max-batch-size") - { - Description = @"Maximum number of concurrent requests", - }; - - private static Option Hf { get; } = new( - name: @"--hf") - { - Description = @"", - }; - - private static Option BaseModel { get; } = new( - name: @"--base-model") - { - Description = @"Base public model", - }; - - private static Option ContainerImage { get; } = new( - name: @"--container-image") - { - Description = @"Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4)", - }; - - private static Option?> ExtraArgs { get; } = new( - name: @"--extra-args") - { - Description = @"Extra command line arguments for custom deployments", - }; - private static readonly ScaleSettingsOptionSet SettingsOptions = ScaleSettingsOptionSet.Create(@"settings"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-create-llm", @"Deploy Create Llm"); - command.Options.Add(XiApiKey); - command.Options.Add(ModelName); - command.Options.Add(Gpu); - command.Options.Add(NumGpus); - command.Options.Add(MaxBatchSize); - command.Options.Add(Hf); - command.Options.Add(BaseModel); - command.Options.Add(ContainerImage); - command.Options.Add(ExtraArgs); command.Options.Add(SettingsOptions.MinInstances); - command.Options.Add(SettingsOptions.MaxInstances); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var modelName = parseResult.GetRequiredValue(ModelName); - var gpu = parseResult.GetRequiredValue(Gpu); - var numGpus = CliRuntime.WasSpecified(parseResult, NumGpus) ? parseResult.GetValue(NumGpus) : (__requestBase is { } __NumGpusBaseValue ? __NumGpusBaseValue.NumGpus : default); - var maxBatchSize = CliRuntime.WasSpecified(parseResult, MaxBatchSize) ? parseResult.GetValue(MaxBatchSize) : (__requestBase is { } __MaxBatchSizeBaseValue ? __MaxBatchSizeBaseValue.MaxBatchSize : default); - var hf = CliRuntime.WasSpecified(parseResult, Hf) ? parseResult.GetValue(Hf) : (__requestBase is { } __HfBaseValue ? __HfBaseValue.Hf : default); - var baseModel = CliRuntime.WasSpecified(parseResult, BaseModel) ? parseResult.GetValue(BaseModel) : (__requestBase is { } __BaseModelBaseValue ? __BaseModelBaseValue.BaseModel : default); - var containerImage = CliRuntime.WasSpecified(parseResult, ContainerImage) ? parseResult.GetValue(ContainerImage) : (__requestBase is { } __ContainerImageBaseValue ? __ContainerImageBaseValue.ContainerImage : default); - var extraArgs = CliRuntime.WasSpecified(parseResult, ExtraArgs) ? parseResult.GetValue(ExtraArgs) : (__requestBase is { } __ExtraArgsBaseValue ? __ExtraArgsBaseValue.ExtraArgs : default); - - var __SettingsBase = __requestBase is { } __SettingsBaseValue ? __SettingsBaseValue.Settings : default; var settingsMinInstances = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) ? parseResult.GetValue(SettingsOptions.MinInstances) : (__SettingsBase is { } __SettingsminInstancesBaseValue ? __SettingsminInstancesBaseValue.MinInstances : default); - var settingsMaxInstances = CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances) ? parseResult.GetValue(SettingsOptions.MaxInstances) : (__SettingsBase is { } __SettingsmaxInstancesBaseValue ? __SettingsmaxInstancesBaseValue.MaxInstances : default); - var __SettingsSpecified = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) || CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances); - var settings = - __SettingsSpecified || __SettingsBase is not null - ? new global::DeepInfra.ScaleSettings - { - MinInstances = settingsMinInstances, - MaxInstances = settingsMaxInstances, - - } - : __SettingsBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployCreateLlmAsync( - xiApiKey: xiApiKey, - modelName: modelName, - gpu: gpu, - numGpus: numGpus, - maxBatchSize: maxBatchSize, - hf: hf, - baseModel: baseModel, - containerImage: containerImage, - extraArgs: extraArgs, - settings: settings, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployDeleteCommandApiCommand.g.cs deleted file mode 100644 index 4892e256..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployDeleteCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployDeleteCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployDelete value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployDelete value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-delete", @"Deploy Delete"); - command.Arguments.Add(DeployId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployDeleteAsync( - deployId: deployId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployDetailedStatsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployDetailedStatsCommandApiCommand.g.cs deleted file mode 100644 index 3e481894..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployDetailedStatsCommandApiCommand.g.cs +++ /dev/null @@ -1,91 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployDetailedStatsCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period, unix ts or 'now-5h', supported units s, m, h, d, w", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period, unix ts or now-relative, check from, defaults to now", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DetailedDeploymentStatsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DetailedDeploymentStatsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-detailed-stats", @"Deploy Detailed Stats"); - command.Arguments.Add(DeployId); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployDetailedStatsAsync( - deployId: deployId, - from: from, - to: to, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployGpuAvailabilityCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployGpuAvailabilityCommandApiCommand.g.cs deleted file mode 100644 index f4d18741..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployGpuAvailabilityCommandApiCommand.g.cs +++ /dev/null @@ -1,89 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployGpuAvailabilityCommandApiCommand -{ - private static Option Source { get; } = new( - name: @"--source") - { - Description = @"", - }; - - private static Option BaseModel { get; } = new( - name: @"--base-model") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-gpu-availability", @"Deploy Gpu Availability"); - command.Options.Add(Source); - command.Options.Add(BaseModel); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var source = parseResult.GetValue(Source); - var baseModel = parseResult.GetValue(BaseModel); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployGpuAvailabilityAsync( - source: source, - baseModel: baseModel, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Gpus", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployList2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployList2CommandApiCommand.g.cs deleted file mode 100644 index 4ae8f18c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployList2CommandApiCommand.g.cs +++ /dev/null @@ -1,80 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployList2CommandApiCommand -{ - private static Option Status { get; } = new( - name: @"--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", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-list2", @"Deploy List"); - command.Options.Add(Status); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var status = parseResult.GetValue(Status); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployList2Async( - status: status, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployStartCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployStartCommandApiCommand.g.cs deleted file mode 100644 index ca928bee..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployStartCommandApiCommand.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployStartCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-start", @"Deploy Start -Start a stopped deployment. Re-creates pods via auto-scaling."); - command.Arguments.Add(DeployId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployStartAsync( - deployId: deployId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployStatsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployStatsCommandApiCommand.g.cs deleted file mode 100644 index 3a7333e6..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployStatsCommandApiCommand.g.cs +++ /dev/null @@ -1,91 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployStatsCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period, unix ts or now-relative, check from, defaults to now", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentStatsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentStatsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-stats", @"Deploy Stats"); - command.Arguments.Add(DeployId); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployStatsAsync( - deployId: deployId, - from: from, - to: to, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployStatusCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployStatusCommandApiCommand.g.cs deleted file mode 100644 index 5dd013f8..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployStatusCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployStatusCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-status", @"Deploy Status"); - command.Arguments.Add(DeployId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployStatusAsync( - deployId: deployId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployStopCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployStopCommandApiCommand.g.cs deleted file mode 100644 index fbb6ee43..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployStopCommandApiCommand.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployStopCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-stop", @"Deploy Stop -Stop a running deployment. Terminates pods. Can be restarted later."); - command.Arguments.Add(DeployId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployStopAsync( - deployId: deployId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeployUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeployUpdateCommandApiCommand.g.cs deleted file mode 100644 index 3dd4bbff..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeployUpdateCommandApiCommand.g.cs +++ /dev/null @@ -1,87 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeployUpdateCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - private static readonly ScaleSettingsOptionSet SettingsOptions = ScaleSettingsOptionSet.Create(@"settings"); - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployStatusOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deploy-update", @"Deploy Update"); - command.Arguments.Add(DeployId); - command.Options.Add(XiApiKey); command.Options.Add(SettingsOptions.MinInstances); - command.Options.Add(SettingsOptions.MaxInstances); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var xiApiKey = parseResult.GetValue(XiApiKey); - var settingsMinInstances = parseResult.GetValue(SettingsOptions.MinInstances); - var settingsMaxInstances = parseResult.GetValue(SettingsOptions.MaxInstances); - var __SettingsSpecified = CliRuntime.WasSpecified(parseResult, SettingsOptions.MinInstances) || CliRuntime.WasSpecified(parseResult, SettingsOptions.MaxInstances); - var settings = - __SettingsSpecified || false - ? new global::DeepInfra.ScaleSettings - { - MinInstances = settingsMinInstances, - MaxInstances = settingsMaxInstances, - - } - : null; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeployUpdateAsync( - deployId: deployId, - xiApiKey: xiApiKey, - settings: settings!, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeploymentLogsQueryCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeploymentLogsQueryCommandApiCommand.g.cs deleted file mode 100644 index ef2a5ac2..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeploymentLogsQueryCommandApiCommand.g.cs +++ /dev/null @@ -1,115 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeploymentLogsQueryCommandApiCommand -{ - private static Option DeployId { get; } = new( - name: @"--deploy-id") - { - Description = @"the deploy id to get the logs from", - Required = true, - }; - - private static Option PodName { get; } = new( - name: @"--pod-name") - { - Description = @"the pod name to get the logs from", - }; - - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period, in fractional seconds since unix epoch (inclusive)", - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period, in fractional seconds since unix epoch (exclusive)", - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"how many items to return at most (default 100, in [1, 1000])", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentLogQueryOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentLogQueryOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deployment-logs-query", @"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."); - command.Options.Add(DeployId); - command.Options.Add(PodName); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(Limit); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var podName = parseResult.GetValue(PodName); - var from = parseResult.GetValue(From); - var to = parseResult.GetValue(To); - var limit = parseResult.GetValue(Limit); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeploymentLogsQueryAsync( - deployId: deployId, - podName: podName, - from: from, - to: to, - limit: limit, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/DeploymentStatsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/DeploymentStatsCommandApiCommand.g.cs deleted file mode 100644 index c7fbd0d5..00000000 --- a/src/cli/DeepInfra.CLI/Commands/DeploymentStatsCommandApiCommand.g.cs +++ /dev/null @@ -1,90 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class DeploymentStatsCommandApiCommand -{ - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth)", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period, unix ts or now-relative, check from, defaults to now", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"deployment-stats", @"Deployment Stats"); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.DeploymentStatsAsync( - from: from, - to: to, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ElevenLabsTextToSpeechInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/ElevenLabsTextToSpeechInOptionSet.g.cs index 2fe328ef..70bed978 100644 --- a/src/cli/DeepInfra.CLI/Commands/ElevenLabsTextToSpeechInOptionSet.g.cs +++ b/src/cli/DeepInfra.CLI/Commands/ElevenLabsTextToSpeechInOptionSet.g.cs @@ -31,7 +31,7 @@ public static ElevenLabsTextToSpeechInOptionSet Create(string? prefix = null) }, LanguageCode: new Option($"--{normalizedPrefix}language-code") { - Description = @"ISO 639-1, 2 letter language code", + Description = @"ISO 639-1, 2-letter language code", } ); } diff --git a/src/cli/DeepInfra.CLI/Commands/EmbeddingsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/EmbeddingsApiGroupCommand.g.cs new file mode 100644 index 00000000..030d130a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/EmbeddingsApiGroupCommand.g.cs @@ -0,0 +1,15 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class EmbeddingsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"embeddings", @"Embeddings endpoint commands."); + command.Subcommands.Add(EmbeddingsOpenaiEmbeddingsCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/EmbeddingsOpenaiEmbeddingsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/EmbeddingsOpenaiEmbeddingsCommandApiCommand.g.cs new file mode 100644 index 00000000..f6beaaad --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/EmbeddingsOpenaiEmbeddingsCommandApiCommand.g.cs @@ -0,0 +1,189 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class EmbeddingsOpenaiEmbeddingsCommandApiCommand +{ + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option UserAgent { get; } = new( + name: @"--user-agent") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.", + }; + + private static Option FailFast { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--fail-fast", + description: @"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior."); + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"model name", + Required = true, + }; + + private static Option>>>> InputOption { get; } = new( + name: @"--input") + { + Description = @"text or multimodal content to embed. Each item is either a string, or a list of content parts ({""type"":""text""} / {""type"":""image_url""}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2.", + Required = true, + }; + + private static Option InputType { get; } = new( + name: @"--input-type") + { + Description = @"Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models.", + }; + + private static Option EncodingFormat { get; } = new( + name: @"--encoding-format") + { + Description = @"format used when encoding", + }; + + private static Option Dimensions { get; } = new( + name: @"--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.", + }; + private static Option RequestInput { get; } = new(@"--request-input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-embeddings", @"Openai Embeddings"); + command.Options.Add(XDeepinfraSource); + command.Options.Add(UserAgent); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ServiceTier); + command.Options.Add(FailFast); + command.Options.Add(Model); + command.Options.Add(InputOption); + command.Options.Add(InputType); + command.Options.Add(EncodingFormat); + command.Options.Add(Dimensions); + command.Options.Add(RequestInput); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(RequestInput) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --request-input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + RequestInput, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var userAgent = parseResult.GetValue(UserAgent); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + var failFast = CliRuntime.WasSpecified(parseResult, FailFast) ? parseResult.GetValue(FailFast) : (__requestBase is { } __FailFastBaseValue ? __FailFastBaseValue.FailFast : default); + var model = parseResult.GetRequiredValue(Model); + var input = parseResult.GetRequiredValue(InputOption); + var inputType = CliRuntime.WasSpecified(parseResult, InputType) ? parseResult.GetValue(InputType) : (__requestBase is { } __InputTypeBaseValue ? __InputTypeBaseValue.InputType : default); + var encodingFormat = CliRuntime.WasSpecified(parseResult, EncodingFormat) ? parseResult.GetValue(EncodingFormat) : (__requestBase is { } __EncodingFormatBaseValue ? __EncodingFormatBaseValue.EncodingFormat : default); + var dimensions = CliRuntime.WasSpecified(parseResult, Dimensions) ? parseResult.GetValue(Dimensions) : (__requestBase is { } __DimensionsBaseValue ? __DimensionsBaseValue.Dimensions : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Embeddings.OpenaiEmbeddingsAsync( + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + serviceTier: serviceTier, + failFast: failFast, + model: model, + input: input, + inputType: inputType, + encodingFormat: encodingFormat, + dimensions: dimensions, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ExportApiTokenToVercelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ExportApiTokenToVercelCommandApiCommand.g.cs deleted file mode 100644 index d2aea391..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ExportApiTokenToVercelCommandApiCommand.g.cs +++ /dev/null @@ -1,122 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ExportApiTokenToVercelCommandApiCommand -{ - private static Argument ApiToken { get; } = new( - name: @"api-token") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ProjectIdOrName { get; } = new( - name: @"--project-id-or-name") - { - Description = @"", - Required = true, - }; - - private static Option IsSensitive { get; } = new( - name: @"--is-sensitive") - { - Description = @"", - Required = true, - }; - - private static Option EnvDevelopment { get; } = new( - name: @"--env-development") - { - Description = @"", - Required = true, - }; - - private static Option EnvPreview { get; } = new( - name: @"--env-preview") - { - Description = @"", - Required = true, - }; - - private static Option EnvProduction { get; } = new( - name: @"--env-production") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"export-api-token-to-vercel", @"Export Api Token To Vercel"); - command.Arguments.Add(ApiToken); - command.Options.Add(XiApiKey); - command.Options.Add(ProjectIdOrName); - command.Options.Add(IsSensitive); - command.Options.Add(EnvDevelopment); - command.Options.Add(EnvPreview); - command.Options.Add(EnvProduction); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var apiToken = parseResult.GetRequiredValue(ApiToken); - var xiApiKey = parseResult.GetValue(XiApiKey); - var projectIdOrName = parseResult.GetRequiredValue(ProjectIdOrName); - var isSensitive = parseResult.GetRequiredValue(IsSensitive); - var envDevelopment = parseResult.GetRequiredValue(EnvDevelopment); - var envPreview = parseResult.GetRequiredValue(EnvPreview); - var envProduction = parseResult.GetRequiredValue(EnvProduction); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ExportApiTokenToVercelAsync( - apiToken: apiToken, - xiApiKey: xiApiKey, - projectIdOrName: projectIdOrName, - isSensitive: isSensitive, - envDevelopment: envDevelopment, - envPreview: envPreview, - envProduction: envProduction, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesApiGroupCommand.g.cs new file mode 100644 index 00000000..1fc33e96 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesApiGroupCommand.g.cs @@ -0,0 +1,23 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class FilesBatchesApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"files-batches", @"Files & Batches endpoint commands."); + command.Subcommands.Add(FilesBatchesCancelOpenaiBatchCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesCreateOpenaiBatchCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesDeleteFileCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesGetFileCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesGetFileContentCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesListFilesCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesOpenaiFilesCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesRetrieveOpenaiBatchCommandApiCommand.Create()); + command.Subcommands.Add(FilesBatchesRetrieveOpenaiBatchesCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesCancelOpenaiBatchCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesCancelOpenaiBatchCommandApiCommand.g.cs new file mode 100644 index 00000000..08e97807 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesCancelOpenaiBatchCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesCancelOpenaiBatchCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIBatchesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIBatchesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"cancel-openai-batch", @"Cancel Openai Batch"); + command.Arguments.Add(BatchId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.CancelOpenaiBatchAsync( + batchId: batchId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesCreateOpenaiBatchCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesCreateOpenaiBatchCommandApiCommand.g.cs new file mode 100644 index 00000000..9ed9565f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesCreateOpenaiBatchCommandApiCommand.g.cs @@ -0,0 +1,156 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesCreateOpenaiBatchCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option InputFileId { get; } = new( + name: @"--input-file-id") + { + Description = @"The ID of an uploaded file that contains requests for the new batch.", + Required = true, + }; + + private static Option Endpoint { get; } = new( + name: @"--endpoint") + { + Description = @"The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions, /v1/embeddings are supported.", + Required = true, + }; + + private static Option CompletionWindow { get; } = new( + name: @"--completion-window") + { + Description = @"The time frame within which the batch should be processed. Currently only 24h is supported.", + DefaultValueFactory = _ => "24h", + }; + + private static Option?> Metadata { get; } = new( + name: @"--metadata") + { + Description = @"Optional metadata to be stored with the batch.", + }; + + private static Option OutputExpiresAfter { get; } = new( + name: @"--output-expires-after") + { + Description = @"The expiration policy for the output and/or error file generated for the batch.", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIBatchesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIBatchesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-openai-batch", @"Create Openai Batch"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(InputFileId); + command.Options.Add(Endpoint); + command.Options.Add(CompletionWindow); + command.Options.Add(Metadata); + command.Options.Add(OutputExpiresAfter); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var inputFileId = parseResult.GetRequiredValue(InputFileId); + var endpoint = parseResult.GetRequiredValue(Endpoint); + var completionWindow = parseResult.GetRequiredValue(CompletionWindow); + var metadata = CliRuntime.WasSpecified(parseResult, Metadata) ? parseResult.GetValue(Metadata) : (__requestBase is { } __MetadataBaseValue ? __MetadataBaseValue.Metadata : default); + var outputExpiresAfter = CliRuntime.WasSpecified(parseResult, OutputExpiresAfter) ? parseResult.GetValue(OutputExpiresAfter) : (__requestBase is { } __OutputExpiresAfterBaseValue ? __OutputExpiresAfterBaseValue.OutputExpiresAfter : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.CreateOpenaiBatchAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + inputFileId: inputFileId, + endpoint: endpoint, + completionWindow: completionWindow, + metadata: metadata, + outputExpiresAfter: outputExpiresAfter, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesDeleteFileCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesDeleteFileCommandApiCommand.g.cs new file mode 100644 index 00000000..e24d35e7 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesDeleteFileCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesDeleteFileCommandApiCommand +{ + private static Argument FileId { get; } = new( + name: @"file-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-file", @"Delete File"); + command.Arguments.Add(FileId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var fileId = parseResult.GetRequiredValue(FileId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.DeleteFileAsync( + fileId: fileId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesGetFileCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesGetFileCommandApiCommand.g.cs new file mode 100644 index 00000000..66e40cdf --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesGetFileCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesGetFileCommandApiCommand +{ + private static Argument FileId { get; } = new( + name: @"file-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIFile value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIFile value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-file", @"Get File"); + command.Arguments.Add(FileId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var fileId = parseResult.GetRequiredValue(FileId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.GetFileAsync( + fileId: fileId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesGetFileContentCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesGetFileContentCommandApiCommand.g.cs new file mode 100644 index 00000000..4c5cf5f4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesGetFileContentCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesGetFileContentCommandApiCommand +{ + private static Argument FileId { get; } = new( + name: @"file-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-file-content", @"Get File Content"); + command.Arguments.Add(FileId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var fileId = parseResult.GetRequiredValue(FileId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.GetFileContentAsync( + fileId: fileId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesListFilesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesListFilesCommandApiCommand.g.cs new file mode 100644 index 00000000..fc7d1514 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesListFilesCommandApiCommand.g.cs @@ -0,0 +1,108 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesListFilesCommandApiCommand +{ + private static Option After { get; } = new( + name: @"--after") + { + Description = @"", + }; + + private static Option Purpose { get; } = new( + name: @"--purpose") + { + Description = @"", + }; + + private static Option Order { get; } = new( + name: @"--order") + { + Description = @"", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list-files", @"List Files"); + command.Options.Add(After); + command.Options.Add(Purpose); + command.Options.Add(Order); + command.Options.Add(Limit); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var after = parseResult.GetValue(After); + var purpose = parseResult.GetValue(Purpose); + var order = parseResult.GetValue(Order); + var limit = parseResult.GetValue(Limit); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.ListFilesAsync( + after: after, + purpose: purpose, + order: order, + limit: limit, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesOpenaiFilesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesOpenaiFilesCommandApiCommand.g.cs new file mode 100644 index 00000000..6fe01259 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesOpenaiFilesCommandApiCommand.g.cs @@ -0,0 +1,92 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesOpenaiFilesCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Purpose { get; } = new( + name: @"--purpose") + { + Description = @"", + Required = true, + }; + + private static Option> File { get; } = new( + name: @"--file") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-files", @"Openai Files"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Purpose); + command.Options.Add(File); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var purpose = parseResult.GetRequiredValue(Purpose); + var file = parseResult.GetRequiredValue(File); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.OpenaiFilesAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + purpose: purpose, + file: file, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesRetrieveOpenaiBatchCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesRetrieveOpenaiBatchCommandApiCommand.g.cs new file mode 100644 index 00000000..a0e483fc --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesRetrieveOpenaiBatchCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesRetrieveOpenaiBatchCommandApiCommand +{ + private static Argument BatchId { get; } = new( + name: @"batch-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIBatchesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIBatchesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"retrieve-openai-batch", @"Retrieve Openai Batch"); + command.Arguments.Add(BatchId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var batchId = parseResult.GetRequiredValue(BatchId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.RetrieveOpenaiBatchAsync( + batchId: batchId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/FilesBatchesRetrieveOpenaiBatchesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/FilesBatchesRetrieveOpenaiBatchesCommandApiCommand.g.cs new file mode 100644 index 00000000..ffcedd9d --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/FilesBatchesRetrieveOpenaiBatchesCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class FilesBatchesRetrieveOpenaiBatchesCommandApiCommand +{ + private static Option After { get; } = new( + name: @"--after") + { + Description = @"", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"retrieve-openai-batches", @"Retrieve Openai Batches"); + command.Options.Add(After); + command.Options.Add(Limit); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var after = parseResult.GetValue(After); + var limit = parseResult.GetValue(Limit); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.FilesBatches.RetrieveOpenaiBatchesAsync( + after: after, + limit: limit, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GPURentalsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GPURentalsApiGroupCommand.g.cs new file mode 100644 index 00000000..2170b3d4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GPURentalsApiGroupCommand.g.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class GPURentalsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"gpu-rentals", @"GPU Rentals endpoint commands."); + command.Subcommands.Add(GpuRentalsContainerRentalsDeleteCommandApiCommand.Create()); + command.Subcommands.Add(GpuRentalsContainerRentalsGetCommandApiCommand.Create()); + command.Subcommands.Add(GpuRentalsContainerRentalsGetParamsCommandApiCommand.Create()); + command.Subcommands.Add(GpuRentalsContainerRentalsListCommandApiCommand.Create()); + command.Subcommands.Add(GpuRentalsContainerRentalsStartCommandApiCommand.Create()); + command.Subcommands.Add(GpuRentalsContainerRentalsUpdateCommandApiCommand.Create()); + command.Subcommands.Add(GpuRentalsRentGpuAvailabilityCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetApiTokenCommandApiCommand.g.cs deleted file mode 100644 index 145fa8a6..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetApiTokenCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetApiTokenCommandApiCommand -{ - private static Argument ApiToken { get; } = new( - name: @"api-token") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ApiToken value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ApiToken value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-api-token", @"Get Api Token"); - command.Arguments.Add(ApiToken); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var apiToken = parseResult.GetRequiredValue(ApiToken); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetApiTokenAsync( - apiToken: apiToken, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetApiTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetApiTokensCommandApiCommand.g.cs deleted file mode 100644 index b7dd7240..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetApiTokensCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetApiTokensCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-api-tokens", @"Get Api Tokens"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetApiTokensAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetChecklistCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetChecklistCommandApiCommand.g.cs deleted file mode 100644 index 02bce525..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetChecklistCommandApiCommand.g.cs +++ /dev/null @@ -1,70 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetChecklistCommandApiCommand -{ - private static Option ComputeOwed { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--compute-owed", - description: @""); - - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Checklist value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Checklist value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-checklist", @"Get Checklist"); - command.Options.Add(ComputeOwed); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var computeOwed = parseResult.GetValue(ComputeOwed); - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetChecklistAsync( - computeOwed: computeOwed, - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetConfigCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetConfigCommandApiCommand.g.cs deleted file mode 100644 index 2acbfea5..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetConfigCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetConfigCommandApiCommand -{ - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ConfigOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ConfigOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-config", @"Get Config"); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetConfigAsync( - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetHardwareCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetHardwareCommandApiCommand.g.cs deleted file mode 100644 index 09db159c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetHardwareCommandApiCommand.g.cs +++ /dev/null @@ -1,81 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetHardwareCommandApiCommand -{ - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"Model name (NVIDIA NemoClaw format)", - Required = true, - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.HardwareResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.HardwareResponse value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-hardware", @"Get Hardware"); - command.Options.Add(Model); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var model = parseResult.GetRequiredValue(Model); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetHardwareAsync( - model: model, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Hardware", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetLiveMetricsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetLiveMetricsCommandApiCommand.g.cs deleted file mode 100644 index 37ec13e6..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetLiveMetricsCommandApiCommand.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetLiveMetricsCommandApiCommand -{ - - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.WebLiveMetricsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.WebLiveMetricsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-live-metrics", @"Get Live Metrics -Get the latest values for the Live metrics section on the web front page."); - - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetLiveMetricsAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetLoraCommandApiCommand.g.cs deleted file mode 100644 index c574642e..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetLoraCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetLoraCommandApiCommand -{ - private static Argument LoraName { get; } = new( - name: @"lora-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-lora", @"Get Lora"); - command.Arguments.Add(LoraName); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var loraName = parseResult.GetRequiredValue(LoraName); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetLoraAsync( - loraName: loraName, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetLoraStatusCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetLoraStatusCommandApiCommand.g.cs deleted file mode 100644 index c7889d1e..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetLoraStatusCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetLoraStatusCommandApiCommand -{ - private static Argument LoraName { get; } = new( - name: @"lora-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-lora-status", @"Get Lora Status"); - command.Arguments.Add(LoraName); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var loraName = parseResult.GetRequiredValue(LoraName); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetLoraStatusAsync( - loraName: loraName, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetModelLorasCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetModelLorasCommandApiCommand.g.cs deleted file mode 100644 index ae31a06a..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetModelLorasCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetModelLorasCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-model-loras", @"Get Model Loras"); - command.Arguments.Add(ModelName); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetModelLorasAsync( - modelName: modelName, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetRequestCostsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetRequestCostsCommandApiCommand.g.cs deleted file mode 100644 index 0cfadc73..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetRequestCostsCommandApiCommand.g.cs +++ /dev/null @@ -1,81 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetRequestCostsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option> RequestIds { get; } = new( - name: @"--request-ids") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RequestCostResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RequestCostResponse value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-request-costs", @"Get Request Costs"); - command.Options.Add(XiApiKey); - command.Options.Add(RequestIds); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - var requestIds = parseResult.GetRequiredValue(RequestIds); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetRequestCostsAsync( - xiApiKey: xiApiKey, - requestIds: requestIds, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Requests", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetSshKeysCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetSshKeysCommandApiCommand.g.cs deleted file mode 100644 index 64c5300c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetSshKeysCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetSshKeysCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-ssh-keys", @"Get Ssh Keys"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetSshKeysAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetUserLorasCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetUserLorasCommandApiCommand.g.cs deleted file mode 100644 index 021c0443..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetUserLorasCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetUserLorasCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-user-loras", @"Get User Loras"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetUserLorasAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetVoiceCommandApiCommand.g.cs deleted file mode 100644 index 9a683595..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetVoiceCommandApiCommand.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetVoiceCommandApiCommand -{ - private static Argument VoiceId { get; } = new( - name: @"voice-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Voice value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Voice value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-voice", @"Get Voice -Get a voice by its id"); - command.Arguments.Add(VoiceId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var voiceId = parseResult.GetRequiredValue(VoiceId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetVoiceAsync( - voiceId: voiceId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GetVoicesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GetVoicesCommandApiCommand.g.cs deleted file mode 100644 index 90136588..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GetVoicesCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GetVoicesCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.GetVoicesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.GetVoicesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"get-voices", @"Get Voices -Get available voices for a given user"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GetVoicesAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Voices", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GithubCliLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GithubCliLoginCommandApiCommand.g.cs deleted file mode 100644 index f2e37d96..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GithubCliLoginCommandApiCommand.g.cs +++ /dev/null @@ -1,66 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GithubCliLoginCommandApiCommand -{ - private static Option LoginId { get; } = new( - name: @"--login-id") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"github-cli-login", @"Github Cli Login -deepctl is calling this request waiting for auth token during login. -The token is stored in /github/callback"); - command.Options.Add(LoginId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var loginId = parseResult.GetRequiredValue(LoginId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GithubCliLoginAsync( - loginId: loginId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GithubLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GithubLoginCommandApiCommand.g.cs deleted file mode 100644 index 21fc1f42..00000000 --- a/src/cli/DeepInfra.CLI/Commands/GithubLoginCommandApiCommand.g.cs +++ /dev/null @@ -1,91 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class GithubLoginCommandApiCommand -{ - private static Option LoginId { get; } = new( - name: @"--login-id") - { - Description = @"", - }; - - private static Option Origin { get; } = new( - name: @"--origin") - { - Description = @"", - }; - - private static Option Deal { get; } = new( - name: @"--deal") - { - Description = @"", - }; - - private static Option TiToken { get; } = new( - name: @"--ti-token") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"github-login", @"Github Login -Initiate github SSO login flow. Callback is /github/callback"); - command.Options.Add(LoginId); - command.Options.Add(Origin); - command.Options.Add(Deal); - command.Options.Add(TiToken); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var loginId = parseResult.GetValue(LoginId); - var origin = parseResult.GetValue(Origin); - var deal = parseResult.GetValue(Deal); - var tiToken = parseResult.GetValue(TiToken); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.GithubLoginAsync( - loginId: loginId, - origin: origin, - deal: deal, - tiToken: tiToken, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..f78ac2c7 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsDeleteCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsContainerRentalsDeleteCommandApiCommand +{ + private static Argument ContainerId { get; } = new( + name: @"container-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"container-rentals-delete", @"Container Rentals Delete"); + command.Arguments.Add(ContainerId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var containerId = parseResult.GetRequiredValue(ContainerId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.ContainerRentalsDeleteAsync( + containerId: containerId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsGetCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsGetCommandApiCommand.g.cs new file mode 100644 index 00000000..96031e4c --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsGetCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsContainerRentalsGetCommandApiCommand +{ + private static Argument ContainerId { get; } = new( + name: @"container-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ContainerRentalOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ContainerRentalOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"container-rentals-get", @"Container Rentals Get"); + command.Arguments.Add(ContainerId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var containerId = parseResult.GetRequiredValue(ContainerId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.ContainerRentalsGetAsync( + containerId: containerId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsGetParamsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsGetParamsCommandApiCommand.g.cs new file mode 100644 index 00000000..6468d4f7 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsGetParamsCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsContainerRentalsGetParamsCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"container-rentals-get-params", @"Container Rentals Get Params"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.ContainerRentalsGetParamsAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsListCommandApiCommand.g.cs new file mode 100644 index 00000000..c7793f59 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsListCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsContainerRentalsListCommandApiCommand +{ + private static Option State { get; } = new( + name: @"--state") + { + Description = @"whether to return active or inactive containers", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"container-rentals-list", @"Container Rentals List"); + command.Options.Add(State); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var state = parseResult.GetValue(State); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.ContainerRentalsListAsync( + state: state, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsStartCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsStartCommandApiCommand.g.cs new file mode 100644 index 00000000..b87d4ba8 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsStartCommandApiCommand.g.cs @@ -0,0 +1,111 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsContainerRentalsStartCommandApiCommand +{ + private static Argument NameOption { get; } = new( + name: @"name") + { + Description = @"Container Name", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option GpuConfig { get; } = new( + name: @"--gpu-config") + { + Description = @"GPU config", + Required = true, + }; + + private static Option ContainerImage { get; } = new( + name: @"--container-image") + { + Description = @"Container Image", + Required = true, + }; + + private static Option CloudInitUserData { get; } = new( + name: @"--cloud-init-user-data") + { + Description = @"Cloud Init User Data", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ContainerRentalStartOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ContainerRentalStartOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"container-rentals-start", @"Container Rentals Start"); + command.Arguments.Add(NameOption); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(GpuConfig); + command.Options.Add(ContainerImage); + command.Options.Add(CloudInitUserData); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var name = parseResult.GetRequiredValue(NameOption); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var gpuConfig = parseResult.GetRequiredValue(GpuConfig); + var containerImage = parseResult.GetRequiredValue(ContainerImage); + var cloudInitUserData = parseResult.GetRequiredValue(CloudInitUserData); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.ContainerRentalsStartAsync( + name: name, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + gpuConfig: gpuConfig, + containerImage: containerImage, + cloudInitUserData: cloudInitUserData, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsUpdateCommandApiCommand.g.cs new file mode 100644 index 00000000..badccd69 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsContainerRentalsUpdateCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsContainerRentalsUpdateCommandApiCommand +{ + private static Argument ContainerId { get; } = new( + name: @"container-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option NameOption { get; } = new( + name: @"--name") + { + Description = @"Container Name", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"container-rentals-update", @"Container Rentals Update"); + command.Arguments.Add(ContainerId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(NameOption); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var containerId = parseResult.GetRequiredValue(ContainerId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var name = parseResult.GetRequiredValue(NameOption); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.ContainerRentalsUpdateAsync( + containerId: containerId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + name: name, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/GpuRentalsRentGpuAvailabilityCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/GpuRentalsRentGpuAvailabilityCommandApiCommand.g.cs new file mode 100644 index 00000000..1b1ee8af --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/GpuRentalsRentGpuAvailabilityCommandApiCommand.g.cs @@ -0,0 +1,98 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class GpuRentalsRentGpuAvailabilityCommandApiCommand +{ + private static Option Source { get; } = new( + name: @"--source") + { + Description = @"", + }; + + private static Option BaseModel { get; } = new( + name: @"--base-model") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"rent-gpu-availability", @"Rent Gpu Availability"); + command.Options.Add(Source); + command.Options.Add(BaseModel); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var source = parseResult.GetValue(Source); + var baseModel = parseResult.GetValue(BaseModel); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.GpuRentals.RentGpuAvailabilityAsync( + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Gpus", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ImageGenerationApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ImageGenerationApiGroupCommand.g.cs new file mode 100644 index 00000000..5e243d6a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ImageGenerationApiGroupCommand.g.cs @@ -0,0 +1,17 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class ImageGenerationApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"image-generation", @"Image Generation endpoint commands."); + command.Subcommands.Add(ImageGenerationOpenaiImagesEditsCommandApiCommand.Create()); + command.Subcommands.Add(ImageGenerationOpenaiImagesGenerationsCommandApiCommand.Create()); + command.Subcommands.Add(ImageGenerationOpenaiImagesVariationsCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesEditsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesEditsCommandApiCommand.g.cs new file mode 100644 index 00000000..a9e538d8 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesEditsCommandApiCommand.g.cs @@ -0,0 +1,166 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ImageGenerationOpenaiImagesEditsCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Image { get; } = new( + name: @"--image") + { + Description = @"", + Required = true, + }; + + private static Option Imagename { get; } = new( + name: @"--imagename") + { + Description = @"", + Required = true, + }; + + private static Option Inp { get; } = new( + name: @"--inp") + { + Description = @"", + }; + + private static Option Prompt { get; } = new( + name: @"--prompt") + { + Description = @"", + Required = true, + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"", + Required = true, + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-images-edits", @"Openai Images Edits +Edit image using OpenAI Images Edits API"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Image); + command.Options.Add(Imagename); + command.Options.Add(Inp); + command.Options.Add(Prompt); + command.Options.Add(Model); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var image = parseResult.GetRequiredValue(Image); + var imagename = parseResult.GetRequiredValue(Imagename); + var inp = CliRuntime.WasSpecified(parseResult, Inp) ? parseResult.GetValue(Inp) : (__requestBase is { } __InpBaseValue ? __InpBaseValue.Inp : default); + var prompt = parseResult.GetRequiredValue(Prompt); + var model = parseResult.GetRequiredValue(Model); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ImageGeneration.OpenaiImagesEditsAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + image: image, + imagename: imagename, + inp: inp, + prompt: prompt, + model: model, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesGenerationsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesGenerationsCommandApiCommand.g.cs new file mode 100644 index 00000000..d64f0e31 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesGenerationsCommandApiCommand.g.cs @@ -0,0 +1,191 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ImageGenerationOpenaiImagesGenerationsCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"The model to use for image generation.", + Required = true, + }; + + private static Option N { get; } = new( + name: @"--n") + { + Description = @"The number of images to generate.", + }; + + private static Option ResponseFormat { get; } = new( + name: @"--response-format") + { + Description = @"The format in which the generated images are returned. Currently only b64_json is supported.", + }; + + private static Option Size { get; } = new( + name: @"--size") + { + Description = @"The size of the generated images. Available sizes depend on the model.", + }; + + private static Option User { get; } = new( + name: @"--user") + { + Description = @"A unique identifier representing your end-user, which can help to monitor and detect abuse.", + }; + + private static Option Prompt { get; } = new( + name: @"--prompt") + { + Description = @"A text description of desired image(s).", + Required = true, + }; + + private static Option Quality { get; } = new( + name: @"--quality") + { + Description = @"The quality of the image that will be generated.", + }; + + private static Option Style { get; } = new( + name: @"--style") + { + Description = @"The style of the generated images.", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-images-generations", @"Openai Images Generations +Generate image using OpenAI Images API"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Model); + command.Options.Add(N); + command.Options.Add(ResponseFormat); + command.Options.Add(Size); + command.Options.Add(User); + command.Options.Add(Prompt); + command.Options.Add(Quality); + command.Options.Add(Style); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var model = parseResult.GetRequiredValue(Model); + var n = CliRuntime.WasSpecified(parseResult, N) ? parseResult.GetValue(N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); + var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); + var size = CliRuntime.WasSpecified(parseResult, Size) ? parseResult.GetValue(Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); + var user = CliRuntime.WasSpecified(parseResult, User) ? parseResult.GetValue(User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); + var prompt = parseResult.GetRequiredValue(Prompt); + var quality = CliRuntime.WasSpecified(parseResult, Quality) ? parseResult.GetValue(Quality) : (__requestBase is { } __QualityBaseValue ? __QualityBaseValue.Quality : default); + var style = CliRuntime.WasSpecified(parseResult, Style) ? parseResult.GetValue(Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ImageGeneration.OpenaiImagesGenerationsAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + model: model, + n: n, + responseFormat: responseFormat, + size: size, + user: user, + prompt: prompt, + quality: quality, + style: style, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesVariationsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesVariationsCommandApiCommand.g.cs new file mode 100644 index 00000000..a08bd290 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ImageGenerationOpenaiImagesVariationsCommandApiCommand.g.cs @@ -0,0 +1,156 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ImageGenerationOpenaiImagesVariationsCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Image { get; } = new( + name: @"--image") + { + Description = @"", + Required = true, + }; + + private static Option Imagename { get; } = new( + name: @"--imagename") + { + Description = @"", + Required = true, + }; + + private static Option Inp { get; } = new( + name: @"--inp") + { + Description = @"", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"", + Required = true, + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-images-variations", @"Openai Images Variations +Generate a similar image using OpenAI Images Variations API"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Image); + command.Options.Add(Imagename); + command.Options.Add(Inp); + command.Options.Add(Model); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var image = parseResult.GetRequiredValue(Image); + var imagename = parseResult.GetRequiredValue(Imagename); + var inp = CliRuntime.WasSpecified(parseResult, Inp) ? parseResult.GetValue(Inp) : (__requestBase is { } __InpBaseValue ? __InpBaseValue.Inp : default); + var model = parseResult.GetRequiredValue(Model); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.ImageGeneration.OpenaiImagesVariationsAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + image: image, + imagename: imagename, + inp: inp, + model: model, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/InferenceApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/InferenceApiGroupCommand.g.cs new file mode 100644 index 00000000..38b7c890 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/InferenceApiGroupCommand.g.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class InferenceApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"inference", @"Inference endpoint commands."); + command.Subcommands.Add(InferenceInferenceDeployCommandApiCommand.Create()); + command.Subcommands.Add(InferenceInferenceModelCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/InferenceDeployCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/InferenceDeployCommandApiCommand.g.cs deleted file mode 100644 index 9f245c5d..00000000 --- a/src/cli/DeepInfra.CLI/Commands/InferenceDeployCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class InferenceDeployCommandApiCommand -{ - private static Argument DeployId { get; } = new( - name: @"deploy-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"inference-deploy", @"Inference Deploy"); - command.Arguments.Add(DeployId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.InferenceDeployAsync( - deployId: deployId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/InferenceInferenceDeployCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/InferenceInferenceDeployCommandApiCommand.g.cs new file mode 100644 index 00000000..c917f001 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/InferenceInferenceDeployCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class InferenceInferenceDeployCommandApiCommand +{ + private static Argument DeployId { get; } = new( + name: @"deploy-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deploy", @"Inference Deploy"); + command.Arguments.Add(DeployId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Inference.InferenceDeployAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/InferenceInferenceModelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/InferenceInferenceModelCommandApiCommand.g.cs new file mode 100644 index 00000000..0cdc8add --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/InferenceInferenceModelCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class InferenceInferenceModelCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option Version { get; } = new( + name: @"--version") + { + Description = @"model version to run inference against", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"model", @"Inference Model"); + command.Arguments.Add(ModelName); + command.Options.Add(Version); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var version = parseResult.GetValue(Version); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Inference.InferenceModelAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/InferenceModelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/InferenceModelCommandApiCommand.g.cs deleted file mode 100644 index c35dbea0..00000000 --- a/src/cli/DeepInfra.CLI/Commands/InferenceModelCommandApiCommand.g.cs +++ /dev/null @@ -1,81 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class InferenceModelCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option Version { get; } = new( - name: @"--version") - { - Description = @"model version to run inference against", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"inference-model", @"Inference Model"); - command.Arguments.Add(ModelName); - command.Options.Add(Version); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var version = parseResult.GetValue(Version); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.InferenceModelAsync( - modelName: modelName, - version: version, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/InspectScopedJwtCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/InspectScopedJwtCommandApiCommand.g.cs deleted file mode 100644 index 36bbc1c4..00000000 --- a/src/cli/DeepInfra.CLI/Commands/InspectScopedJwtCommandApiCommand.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class InspectScopedJwtCommandApiCommand -{ - private static Option Jwtoken { get; } = new( - name: @"--jwtoken") - { - Description = @"", - Required = true, - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.InspectScopedJWTOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.InspectScopedJWTOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"inspect-scoped-jwt", @"Inspect Scoped Jwt"); - command.Options.Add(Jwtoken); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var jwtoken = parseResult.GetRequiredValue(Jwtoken); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.InspectScopedJwtAsync( - jwtoken: jwtoken, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ListFiles2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ListFiles2CommandApiCommand.g.cs deleted file mode 100644 index 804eb110..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ListFiles2CommandApiCommand.g.cs +++ /dev/null @@ -1,99 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ListFiles2CommandApiCommand -{ - private static Option After { get; } = new( - name: @"--after") - { - Description = @"", - }; - - private static Option Purpose { get; } = new( - name: @"--purpose") - { - Description = @"", - }; - - private static Option Order { get; } = new( - name: @"--order") - { - Description = @"", - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"list-files2", @"List Files"); - command.Options.Add(After); - command.Options.Add(Purpose); - command.Options.Add(Order); - command.Options.Add(Limit); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var after = parseResult.GetValue(After); - var purpose = parseResult.GetValue(Purpose); - var order = parseResult.GetValue(Order); - var limit = parseResult.GetValue(Limit); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ListFiles2Async( - after: after, - purpose: purpose, - order: order, - limit: limit, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ListFilesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ListFilesCommandApiCommand.g.cs deleted file mode 100644 index b838010f..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ListFilesCommandApiCommand.g.cs +++ /dev/null @@ -1,99 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ListFilesCommandApiCommand -{ - private static Option After { get; } = new( - name: @"--after") - { - Description = @"", - }; - - private static Option Purpose { get; } = new( - name: @"--purpose") - { - Description = @"", - }; - - private static Option Order { get; } = new( - name: @"--order") - { - Description = @"", - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"list-files", @"List Files"); - command.Options.Add(After); - command.Options.Add(Purpose); - command.Options.Add(Order); - command.Options.Add(Limit); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var after = parseResult.GetValue(After); - var purpose = parseResult.GetValue(Purpose); - var order = parseResult.GetValue(Order); - var limit = parseResult.GetValue(Limit); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ListFilesAsync( - after: after, - purpose: purpose, - order: order, - limit: limit, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersApiGroupCommand.g.cs new file mode 100644 index 00000000..5f15a30c --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersApiGroupCommand.g.cs @@ -0,0 +1,23 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class LoRAAdaptersApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"lo-ra-adapters", @"LoRA Adapters endpoint commands."); + command.Subcommands.Add(LoRAAdaptersCreateLoraCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersDeleteLoraCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersDeleteLoraModelCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersGetLoraCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersGetLoraStatusCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersGetModelLorasCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersGetUserLorasCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersUpdateLoraCommandApiCommand.Create()); + command.Subcommands.Add(LoRAAdaptersUploadLoraModelCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersCreateLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersCreateLoraCommandApiCommand.g.cs new file mode 100644 index 00000000..fede5bb1 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersCreateLoraCommandApiCommand.g.cs @@ -0,0 +1,157 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersCreateLoraCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option BaseModel { get; } = new( + name: @"--base-model") + { + Description = @"", + Required = true, + }; + + private static Option LoraName { get; } = new( + name: @"--lora-name") + { + Description = @"", + Required = true, + }; + + private static Option Source { get; } = new( + name: @"--source") + { + Description = @"", + Required = true, + }; + + private static Option Private { get; } = new( + name: @"--private") + { + Description = @"", + Required = true, + }; + + private static Option DescriptionOption { get; } = new( + name: @"--description") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-lora", @"Create Lora"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(BaseModel); + command.Options.Add(LoraName); + command.Options.Add(Source); + command.Options.Add(Private); + command.Options.Add(DescriptionOption); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var baseModel = parseResult.GetRequiredValue(BaseModel); + var loraName = parseResult.GetRequiredValue(LoraName); + var source = parseResult.GetRequiredValue(Source); + var @private = parseResult.GetRequiredValue(Private); + var description = CliRuntime.WasSpecified(parseResult, DescriptionOption) ? parseResult.GetValue(DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.CreateLoraAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + baseModel: baseModel, + loraName: loraName, + source: source, + @private: @private, + description: description, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersDeleteLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersDeleteLoraCommandApiCommand.g.cs new file mode 100644 index 00000000..856b6cd0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersDeleteLoraCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersDeleteLoraCommandApiCommand +{ + private static Argument LoraName { get; } = new( + name: @"lora-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-lora", @"Delete Lora"); + command.Arguments.Add(LoraName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loraName = parseResult.GetRequiredValue(LoraName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.DeleteLoraAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersDeleteLoraModelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersDeleteLoraModelCommandApiCommand.g.cs new file mode 100644 index 00000000..fbf9bbc6 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersDeleteLoraModelCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersDeleteLoraModelCommandApiCommand +{ + private static Argument LoraModelName { get; } = new( + name: @"lora-model-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-lora-model", @"Delete Lora Model"); + command.Arguments.Add(LoraModelName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loraModelName = parseResult.GetRequiredValue(LoraModelName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.DeleteLoraModelAsync( + loraModelName: loraModelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetLoraCommandApiCommand.g.cs new file mode 100644 index 00000000..021897fe --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetLoraCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersGetLoraCommandApiCommand +{ + private static Argument LoraName { get; } = new( + name: @"lora-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-lora", @"Get Lora"); + command.Arguments.Add(LoraName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loraName = parseResult.GetRequiredValue(LoraName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.GetLoraAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetLoraStatusCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetLoraStatusCommandApiCommand.g.cs new file mode 100644 index 00000000..5e6a6aa8 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetLoraStatusCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersGetLoraStatusCommandApiCommand +{ + private static Argument LoraName { get; } = new( + name: @"lora-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-lora-status", @"Get Lora Status"); + command.Arguments.Add(LoraName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var loraName = parseResult.GetRequiredValue(LoraName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.GetLoraStatusAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetModelLorasCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetModelLorasCommandApiCommand.g.cs new file mode 100644 index 00000000..0d25e7cd --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetModelLorasCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersGetModelLorasCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-model-loras", @"Get Model Loras"); + command.Arguments.Add(ModelName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.GetModelLorasAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetUserLorasCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetUserLorasCommandApiCommand.g.cs new file mode 100644 index 00000000..fcc25066 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersGetUserLorasCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersGetUserLorasCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-user-loras", @"Get User Loras"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.GetUserLorasAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersUpdateLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersUpdateLoraCommandApiCommand.g.cs new file mode 100644 index 00000000..6b677b72 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersUpdateLoraCommandApiCommand.g.cs @@ -0,0 +1,133 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersUpdateLoraCommandApiCommand +{ + private static Argument LoraName { get; } = new( + name: @"lora-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Private { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--private", + description: @""); + + private static Option DescriptionOption { get; } = new( + name: @"--description") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-lora", @"Update Lora"); + command.Arguments.Add(LoraName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Private); + command.Options.Add(DescriptionOption); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var loraName = parseResult.GetRequiredValue(LoraName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var @private = CliRuntime.WasSpecified(parseResult, Private) ? parseResult.GetValue(Private) : (__requestBase is { } __PrivateBaseValue ? __PrivateBaseValue.Private : default); + var description = CliRuntime.WasSpecified(parseResult, DescriptionOption) ? parseResult.GetValue(DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.UpdateLoraAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + @private: @private, + description: description, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersUploadLoraModelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersUploadLoraModelCommandApiCommand.g.cs new file mode 100644 index 00000000..8727f65f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LoRAAdaptersUploadLoraModelCommandApiCommand.g.cs @@ -0,0 +1,146 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LoRAAdaptersUploadLoraModelCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option HfModelName { get; } = new( + name: @"--hf-model-name") + { + Description = @"", + Required = true, + }; + + private static Option HfToken { get; } = new( + name: @"--hf-token") + { + Description = @"", + }; + + private static Option LoraModelName { get; } = new( + name: @"--lora-model-name") + { + Description = @"", + Required = true, + }; + + private static Option BaseModelName { get; } = new( + name: @"--base-model-name") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"upload-lora-model", @"Upload Lora Model"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(HfModelName); + command.Options.Add(HfToken); + command.Options.Add(LoraModelName); + command.Options.Add(BaseModelName); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var hfModelName = parseResult.GetRequiredValue(HfModelName); + var hfToken = CliRuntime.WasSpecified(parseResult, HfToken) ? parseResult.GetValue(HfToken) : (__requestBase is { } __HfTokenBaseValue ? __HfTokenBaseValue.HfToken : default); + var loraModelName = parseResult.GetRequiredValue(LoraModelName); + var baseModelName = CliRuntime.WasSpecified(parseResult, BaseModelName) ? parseResult.GetValue(BaseModelName) : (__requestBase is { } __BaseModelNameBaseValue ? __BaseModelNameBaseValue.BaseModelName : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LoRAAdapters.UploadLoraModelAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + hfModelName: hfModelName, + hfToken: hfToken, + loraModelName: loraModelName, + baseModelName: baseModelName, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LogsMetricsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LogsMetricsApiGroupCommand.g.cs new file mode 100644 index 00000000..a2f6f08b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LogsMetricsApiGroupCommand.g.cs @@ -0,0 +1,18 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class LogsMetricsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"logs-metrics", @"Logs & Metrics endpoint commands."); + command.Subcommands.Add(LogsMetricsDeploymentLogsQueryCommandApiCommand.Create()); + command.Subcommands.Add(LogsMetricsGetLiveMetricsCommandApiCommand.Create()); + command.Subcommands.Add(LogsMetricsGetRequestCostsCommandApiCommand.Create()); + command.Subcommands.Add(LogsMetricsLogsQueryCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LogsMetricsDeploymentLogsQueryCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LogsMetricsDeploymentLogsQueryCommandApiCommand.g.cs new file mode 100644 index 00000000..93252225 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LogsMetricsDeploymentLogsQueryCommandApiCommand.g.cs @@ -0,0 +1,124 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LogsMetricsDeploymentLogsQueryCommandApiCommand +{ + private static Option DeployId { get; } = new( + name: @"--deploy-id") + { + Description = @"the deploy id to get the logs from", + Required = true, + }; + + private static Option PodName { get; } = new( + name: @"--pod-name") + { + Description = @"the pod name to get the logs from", + }; + + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period, in fractional seconds since unix epoch (inclusive)", + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period, in fractional seconds since unix epoch (exclusive)", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"how many items to return at most (default 100, in [1, 1000])", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentLogQueryOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentLogQueryOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deployment-logs-query", @"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."); + command.Options.Add(DeployId); + command.Options.Add(PodName); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(Limit); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var podName = parseResult.GetValue(PodName); + var from = parseResult.GetValue(From); + var to = parseResult.GetValue(To); + var limit = parseResult.GetValue(Limit); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LogsMetrics.DeploymentLogsQueryAsync( + deployId: deployId, + podName: podName, + from: from, + to: to, + limit: limit, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LogsMetricsGetLiveMetricsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LogsMetricsGetLiveMetricsCommandApiCommand.g.cs new file mode 100644 index 00000000..ed290562 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LogsMetricsGetLiveMetricsCommandApiCommand.g.cs @@ -0,0 +1,60 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LogsMetricsGetLiveMetricsCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.WebLiveMetricsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.WebLiveMetricsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-live-metrics", @"Get Live Metrics +Get the latest values for the Live metrics section on the web front page."); + + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LogsMetrics.GetLiveMetricsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LogsMetricsGetRequestCostsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LogsMetricsGetRequestCostsCommandApiCommand.g.cs new file mode 100644 index 00000000..f900e2dd --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LogsMetricsGetRequestCostsCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LogsMetricsGetRequestCostsCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option> RequestIds { get; } = new( + name: @"--request-ids") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RequestCostResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.RequestCostResponse value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-request-costs", @"Get Request Costs"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(RequestIds); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var requestIds = parseResult.GetRequiredValue(RequestIds); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LogsMetrics.GetRequestCostsAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestIds: requestIds, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Requests", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LogsMetricsLogsQueryCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LogsMetricsLogsQueryCommandApiCommand.g.cs new file mode 100644 index 00000000..3378c5f8 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/LogsMetricsLogsQueryCommandApiCommand.g.cs @@ -0,0 +1,123 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class LogsMetricsLogsQueryCommandApiCommand +{ + private static Option DeployId { get; } = new( + name: @"--deploy-id") + { + Description = @"the deploy id to get the logs from", + Required = true, + }; + + private static Option From { get; } = new( + name: @"--from") + { + Description = @"start of period, in fractional seconds since unix epoch (inclusive)", + }; + + private static Option To { get; } = new( + name: @"--to") + { + Description = @"end of period, in fractional seconds since unix epoch (exclusive)", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"how many items to return at most (default 100, in [1, 1000])", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.LogQueryOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.LogQueryOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"logs-query", @"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."); + command.Options.Add(DeployId); + command.Options.Add(From); + command.Options.Add(To); + command.Options.Add(Limit); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var deployId = parseResult.GetRequiredValue(DeployId); + var from = parseResult.GetValue(From); + var to = parseResult.GetValue(To); + var limit = parseResult.GetValue(Limit); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.LogsMetrics.LogsQueryAsync( + deployId: deployId, + from: from, + to: to, + limit: limit, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Entries", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/LogsQueryCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/LogsQueryCommandApiCommand.g.cs deleted file mode 100644 index eed98263..00000000 --- a/src/cli/DeepInfra.CLI/Commands/LogsQueryCommandApiCommand.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class LogsQueryCommandApiCommand -{ - private static Option DeployId { get; } = new( - name: @"--deploy-id") - { - Description = @"the deploy id to get the logs from", - Required = true, - }; - - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period, in fractional seconds since unix epoch (inclusive)", - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period, in fractional seconds since unix epoch (exclusive)", - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"how many items to return at most (default 100, in [1, 1000])", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.LogQueryOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.LogQueryOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"logs-query", @"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."); - command.Options.Add(DeployId); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(Limit); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var deployId = parseResult.GetRequiredValue(DeployId); - var from = parseResult.GetValue(From); - var to = parseResult.GetValue(To); - var limit = parseResult.GetValue(Limit); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.LogsQueryAsync( - deployId: deployId, - from: from, - to: to, - limit: limit, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Entries", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/MeCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/MeCommandApiCommand.g.cs deleted file mode 100644 index 9c4a2580..00000000 --- a/src/cli/DeepInfra.CLI/Commands/MeCommandApiCommand.g.cs +++ /dev/null @@ -1,70 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class MeCommandApiCommand -{ - private static Option Checklist { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--checklist", - description: @""); - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Me value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Me value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"me", @"Me"); - command.Options.Add(Checklist); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var checklist = parseResult.GetValue(Checklist); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.MeAsync( - checklist: checklist, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelDeleteCommandApiCommand.g.cs deleted file mode 100644 index 53a711e4..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelDeleteCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelDeleteCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option Version { get; } = new( - name: @"--version") - { - Description = @"delete a particular version, pass 'ALL' to wipe everything", - Required = true, - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-delete", @"Model Delete"); - command.Arguments.Add(ModelName); - command.Options.Add(Version); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var version = parseResult.GetRequiredValue(Version); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelDeleteAsync( - modelName: modelName, - version: version, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelFamiliesNamesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelFamiliesNamesCommandApiCommand.g.cs deleted file mode 100644 index e5d545f2..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelFamiliesNamesCommandApiCommand.g.cs +++ /dev/null @@ -1,67 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelFamiliesNamesCommandApiCommand -{ - - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-families-names", @"Model Families Names"); - - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelFamiliesNamesAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelFamilyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelFamilyCommandApiCommand.g.cs deleted file mode 100644 index 8628089f..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelFamilyCommandApiCommand.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelFamilyCommandApiCommand -{ - private static Argument FamilyName { get; } = new( - name: @"family-name") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ModelFamilyOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ModelFamilyOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-family", @"Model Family"); - command.Arguments.Add(FamilyName); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var familyName = parseResult.GetRequiredValue(FamilyName); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelFamilyAsync( - familyName: familyName, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelMetaUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelMetaUpdateCommandApiCommand.g.cs deleted file mode 100644 index 9dbdb831..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelMetaUpdateCommandApiCommand.g.cs +++ /dev/null @@ -1,171 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelMetaUpdateCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option DescriptionOption { get; } = new( - name: @"--description") - { - Description = @"short model description in plain text", - }; - - private static Option GithubUrl { get; } = new( - name: @"--github-url") - { - Description = @"source code project link (empty to delete)", - }; - - private static Option PaperUrl { get; } = new( - name: @"--paper-url") - { - Description = @"paper/research link (empty to delete)", - }; - - private static Option LicenseUrl { get; } = new( - name: @"--license-url") - { - Description = @"usage license link (empty to delete)", - }; - - private static Option Readme { get; } = new( - name: @"--readme") - { - Description = @"markdown flavored model readme", - }; - - private static Option CoverImgUrl { get; } = new( - name: @"--cover-img-url") - { - Description = @"dataurl or regular url to cover image (empty to delete)", - }; - - private static Option ReportedType { get; } = new( - name: @"--reported-type") - { - Description = @"model type", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-meta-update", @"Model Meta Update"); - command.Arguments.Add(ModelName); - command.Options.Add(XiApiKey); - command.Options.Add(DescriptionOption); - command.Options.Add(GithubUrl); - command.Options.Add(PaperUrl); - command.Options.Add(LicenseUrl); - command.Options.Add(Readme); - command.Options.Add(CoverImgUrl); - command.Options.Add(ReportedType); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var modelName = parseResult.GetRequiredValue(ModelName); - var xiApiKey = parseResult.GetValue(XiApiKey); - var description = CliRuntime.WasSpecified(parseResult, DescriptionOption) ? parseResult.GetValue(DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); - var githubUrl = CliRuntime.WasSpecified(parseResult, GithubUrl) ? parseResult.GetValue(GithubUrl) : (__requestBase is { } __GithubUrlBaseValue ? __GithubUrlBaseValue.GithubUrl : default); - var paperUrl = CliRuntime.WasSpecified(parseResult, PaperUrl) ? parseResult.GetValue(PaperUrl) : (__requestBase is { } __PaperUrlBaseValue ? __PaperUrlBaseValue.PaperUrl : default); - var licenseUrl = CliRuntime.WasSpecified(parseResult, LicenseUrl) ? parseResult.GetValue(LicenseUrl) : (__requestBase is { } __LicenseUrlBaseValue ? __LicenseUrlBaseValue.LicenseUrl : default); - var readme = CliRuntime.WasSpecified(parseResult, Readme) ? parseResult.GetValue(Readme) : (__requestBase is { } __ReadmeBaseValue ? __ReadmeBaseValue.Readme : default); - var coverImgUrl = CliRuntime.WasSpecified(parseResult, CoverImgUrl) ? parseResult.GetValue(CoverImgUrl) : (__requestBase is { } __CoverImgUrlBaseValue ? __CoverImgUrlBaseValue.CoverImgUrl : default); - var reportedType = CliRuntime.WasSpecified(parseResult, ReportedType) ? parseResult.GetValue(ReportedType) : (__requestBase is { } __ReportedTypeBaseValue ? __ReportedTypeBaseValue.ReportedType : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelMetaUpdateAsync( - modelName: modelName, - xiApiKey: xiApiKey, - description: description, - githubUrl: githubUrl, - paperUrl: paperUrl, - licenseUrl: licenseUrl, - readme: readme, - coverImgUrl: coverImgUrl, - reportedType: reportedType, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelPublicityCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelPublicityCommandApiCommand.g.cs deleted file mode 100644 index edc695cb..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelPublicityCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelPublicityCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Public { get; } = new( - name: @"--public") - { - Description = @"whether to make the model public of private", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-publicity", @"Model Publicity"); - command.Arguments.Add(ModelName); - command.Options.Add(XiApiKey); - command.Options.Add(Public); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var xiApiKey = parseResult.GetValue(XiApiKey); - var @public = parseResult.GetRequiredValue(Public); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelPublicityAsync( - modelName: modelName, - xiApiKey: xiApiKey, - @public: @public, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelSchemaCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelSchemaCommandApiCommand.g.cs deleted file mode 100644 index 10fe9be2..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelSchemaCommandApiCommand.g.cs +++ /dev/null @@ -1,98 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelSchemaCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Argument VariantKey { get; } = new( - name: @"variant-key") - { - Description = @"", - }; - - private static Option Version { get; } = new( - name: @"--version") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.SchemaOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.SchemaOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-schema", @"Model Schema"); - command.Arguments.Add(ModelName); - command.Arguments.Add(VariantKey); - command.Options.Add(Version); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var variantKey = parseResult.GetRequiredValue(VariantKey); - var version = parseResult.GetValue(Version); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelSchemaAsync( - modelName: modelName, - variantKey: variantKey, - version: version, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"FieldsIn", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelVersionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelVersionsCommandApiCommand.g.cs deleted file mode 100644 index 29a9b36f..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelVersionsCommandApiCommand.g.cs +++ /dev/null @@ -1,80 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelVersionsCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"model-versions", @"Model Versions"); - command.Arguments.Add(ModelName); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelVersionsAsync( - modelName: modelName, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsApiGroupCommand.g.cs new file mode 100644 index 00000000..a0ec1bf3 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsApiGroupCommand.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class ModelsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"models", @"Models endpoint commands."); + command.Subcommands.Add(ModelsGetHardwareCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelDeleteCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelFamiliesNamesCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelFamilyCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelMetaUpdateCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelPublicityCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelSchemaCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelVersionsCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelsDeploymentListCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelsFeaturedCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelsInfoCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelsListCommandApiCommand.Create()); + command.Subcommands.Add(ModelsModelsLoraListCommandApiCommand.Create()); + command.Subcommands.Add(ModelsOpenaiModelsCommandApiCommand.Create()); + command.Subcommands.Add(ModelsOpenrouterModelsCommandApiCommand.Create()); + command.Subcommands.Add(ModelsPrivateModelsListCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsDeploymentListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsDeploymentListCommandApiCommand.g.cs deleted file mode 100644 index c53c42e4..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelsDeploymentListCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelsDeploymentListCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"models-deployment-list", @"Models Deployment List"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelsDeploymentListAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsFeaturedCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsFeaturedCommandApiCommand.g.cs deleted file mode 100644 index 186e5657..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelsFeaturedCommandApiCommand.g.cs +++ /dev/null @@ -1,67 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelsFeaturedCommandApiCommand -{ - - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"models-featured", @"Models Featured"); - - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelsFeaturedAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsGetHardwareCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsGetHardwareCommandApiCommand.g.cs new file mode 100644 index 00000000..25e85322 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsGetHardwareCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsGetHardwareCommandApiCommand +{ + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"Model name (NVIDIA NemoClaw format)", + Required = true, + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.HardwareResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.HardwareResponse value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-hardware", @"Get Hardware"); + command.Options.Add(Model); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var model = parseResult.GetRequiredValue(Model); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.GetHardwareAsync( + model: model, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Hardware", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsInfoCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsInfoCommandApiCommand.g.cs deleted file mode 100644 index 7f6e5473..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelsInfoCommandApiCommand.g.cs +++ /dev/null @@ -1,81 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelsInfoCommandApiCommand -{ - private static Argument ModelName { get; } = new( - name: @"model-name") - { - Description = @"", - }; - - private static Option Version { get; } = new( - name: @"--version") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ModelInfoOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ModelInfoOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"models-info", @"Models Info"); - command.Arguments.Add(ModelName); - command.Options.Add(Version); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var modelName = parseResult.GetRequiredValue(ModelName); - var version = parseResult.GetValue(Version); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelsInfoAsync( - modelName: modelName, - version: version, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsListCommandApiCommand.g.cs deleted file mode 100644 index f450877b..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelsListCommandApiCommand.g.cs +++ /dev/null @@ -1,67 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelsListCommandApiCommand -{ - - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"models-list", @"Models List"); - - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelsListAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsLoraListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsLoraListCommandApiCommand.g.cs deleted file mode 100644 index 906b67e4..00000000 --- a/src/cli/DeepInfra.CLI/Commands/ModelsLoraListCommandApiCommand.g.cs +++ /dev/null @@ -1,67 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class ModelsLoraListCommandApiCommand -{ - - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"models-lora-list", @"Models Lora List"); - - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.ModelsLoraListAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..c9ed6c86 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelDeleteCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelDeleteCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option Version { get; } = new( + name: @"--version") + { + Description = @"delete a particular version, pass 'ALL' to wipe everything", + Required = true, + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete", @"Model Delete"); + command.Arguments.Add(ModelName); + command.Options.Add(Version); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var version = parseResult.GetRequiredValue(Version); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelDeleteAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelFamiliesNamesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelFamiliesNamesCommandApiCommand.g.cs new file mode 100644 index 00000000..02c39431 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelFamiliesNamesCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelFamiliesNamesCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"families-names", @"Model Families Names"); + + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelFamiliesNamesAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelFamilyCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelFamilyCommandApiCommand.g.cs new file mode 100644 index 00000000..4ce112ea --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelFamilyCommandApiCommand.g.cs @@ -0,0 +1,63 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelFamilyCommandApiCommand +{ + private static Argument FamilyName { get; } = new( + name: @"family-name") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ModelFamilyOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ModelFamilyOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"family", @"Model Family"); + command.Arguments.Add(FamilyName); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var familyName = parseResult.GetRequiredValue(FamilyName); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelFamilyAsync( + familyName: familyName, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelMetaUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelMetaUpdateCommandApiCommand.g.cs new file mode 100644 index 00000000..5c781156 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelMetaUpdateCommandApiCommand.g.cs @@ -0,0 +1,189 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelMetaUpdateCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option DescriptionOption { get; } = new( + name: @"--description") + { + Description = @"short model description in plain text", + }; + + private static Option GithubUrl { get; } = new( + name: @"--github-url") + { + Description = @"source code project link (empty to delete)", + }; + + private static Option PaperUrl { get; } = new( + name: @"--paper-url") + { + Description = @"paper/research link (empty to delete)", + }; + + private static Option LicenseUrl { get; } = new( + name: @"--license-url") + { + Description = @"usage license link (empty to delete)", + }; + + private static Option Readme { get; } = new( + name: @"--readme") + { + Description = @"markdown flavored model readme", + }; + + private static Option CoverImgUrl { get; } = new( + name: @"--cover-img-url") + { + Description = @"dataurl or regular url to cover image (empty to delete)", + }; + + private static Option SampleOutputUrl { get; } = new( + name: @"--sample-output-url") + { + Description = @"dataurl or regular url to a sample of this model's output, shown on the model page before the first run (empty to delete)", + }; + + private static Option ReportedType { get; } = new( + name: @"--reported-type") + { + Description = @"model type", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"meta-update", @"Model Meta Update"); + command.Arguments.Add(ModelName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(DescriptionOption); + command.Options.Add(GithubUrl); + command.Options.Add(PaperUrl); + command.Options.Add(LicenseUrl); + command.Options.Add(Readme); + command.Options.Add(CoverImgUrl); + command.Options.Add(SampleOutputUrl); + command.Options.Add(ReportedType); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var modelName = parseResult.GetRequiredValue(ModelName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var description = CliRuntime.WasSpecified(parseResult, DescriptionOption) ? parseResult.GetValue(DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); + var githubUrl = CliRuntime.WasSpecified(parseResult, GithubUrl) ? parseResult.GetValue(GithubUrl) : (__requestBase is { } __GithubUrlBaseValue ? __GithubUrlBaseValue.GithubUrl : default); + var paperUrl = CliRuntime.WasSpecified(parseResult, PaperUrl) ? parseResult.GetValue(PaperUrl) : (__requestBase is { } __PaperUrlBaseValue ? __PaperUrlBaseValue.PaperUrl : default); + var licenseUrl = CliRuntime.WasSpecified(parseResult, LicenseUrl) ? parseResult.GetValue(LicenseUrl) : (__requestBase is { } __LicenseUrlBaseValue ? __LicenseUrlBaseValue.LicenseUrl : default); + var readme = CliRuntime.WasSpecified(parseResult, Readme) ? parseResult.GetValue(Readme) : (__requestBase is { } __ReadmeBaseValue ? __ReadmeBaseValue.Readme : default); + var coverImgUrl = CliRuntime.WasSpecified(parseResult, CoverImgUrl) ? parseResult.GetValue(CoverImgUrl) : (__requestBase is { } __CoverImgUrlBaseValue ? __CoverImgUrlBaseValue.CoverImgUrl : default); + var sampleOutputUrl = CliRuntime.WasSpecified(parseResult, SampleOutputUrl) ? parseResult.GetValue(SampleOutputUrl) : (__requestBase is { } __SampleOutputUrlBaseValue ? __SampleOutputUrlBaseValue.SampleOutputUrl : default); + var reportedType = CliRuntime.WasSpecified(parseResult, ReportedType) ? parseResult.GetValue(ReportedType) : (__requestBase is { } __ReportedTypeBaseValue ? __ReportedTypeBaseValue.ReportedType : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelMetaUpdateAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + description: description, + githubUrl: githubUrl, + paperUrl: paperUrl, + licenseUrl: licenseUrl, + readme: readme, + coverImgUrl: coverImgUrl, + sampleOutputUrl: sampleOutputUrl, + reportedType: reportedType, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelPublicityCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelPublicityCommandApiCommand.g.cs new file mode 100644 index 00000000..1a23f703 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelPublicityCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelPublicityCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Public { get; } = new( + name: @"--public") + { + Description = @"whether to make the model public of private", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"publicity", @"Model Publicity"); + command.Arguments.Add(ModelName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Public); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var @public = parseResult.GetRequiredValue(Public); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelPublicityAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + @public: @public, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelSchemaCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelSchemaCommandApiCommand.g.cs new file mode 100644 index 00000000..fe789dd4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelSchemaCommandApiCommand.g.cs @@ -0,0 +1,107 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelSchemaCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Argument VariantKey { get; } = new( + name: @"variant-key") + { + Description = @"", + }; + + private static Option Version { get; } = new( + name: @"--version") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.SchemaOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.SchemaOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"schema", @"Model Schema"); + command.Arguments.Add(ModelName); + command.Arguments.Add(VariantKey); + command.Options.Add(Version); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var variantKey = parseResult.GetRequiredValue(VariantKey); + var version = parseResult.GetValue(Version); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelSchemaAsync( + modelName: modelName, + variantKey: variantKey, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"FieldsIn", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelVersionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelVersionsCommandApiCommand.g.cs new file mode 100644 index 00000000..102839a0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelVersionsCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelVersionsCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"versions", @"Model Versions"); + command.Arguments.Add(ModelName); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelVersionsAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelsDeploymentListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelsDeploymentListCommandApiCommand.g.cs new file mode 100644 index 00000000..1bf2bf86 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelsDeploymentListCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelsDeploymentListCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"deployment-list", @"Models Deployment List"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelsDeploymentListAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelsFeaturedCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelsFeaturedCommandApiCommand.g.cs new file mode 100644 index 00000000..7c5b8b9b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelsFeaturedCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelsFeaturedCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"featured", @"Models Featured"); + + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelsFeaturedAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelsInfoCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelsInfoCommandApiCommand.g.cs new file mode 100644 index 00000000..e4074af0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelsInfoCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelsInfoCommandApiCommand +{ + private static Argument ModelName { get; } = new( + name: @"model-name") + { + Description = @"", + }; + + private static Option Version { get; } = new( + name: @"--version") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ModelInfoOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ModelInfoOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"info", @"Models Info"); + command.Arguments.Add(ModelName); + command.Options.Add(Version); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var modelName = parseResult.GetRequiredValue(ModelName); + var version = parseResult.GetValue(Version); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelsInfoAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelsListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelsListCommandApiCommand.g.cs new file mode 100644 index 00000000..43866b25 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelsListCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelsListCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list", @"Models List"); + + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelsListAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsModelsLoraListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsModelsLoraListCommandApiCommand.g.cs new file mode 100644 index 00000000..3ac6aaf4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelsLoraListCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsModelsLoraListCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"lora-list", @"Models Lora List"); + + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.ModelsLoraListAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsOpenaiModelsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsOpenaiModelsCommandApiCommand.g.cs new file mode 100644 index 00000000..1ec4c835 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsOpenaiModelsCommandApiCommand.g.cs @@ -0,0 +1,98 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsOpenaiModelsCommandApiCommand +{ + private static Option SortBy { get; } = new( + name: @"--sort-by") + { + Description = @"", + }; + + private static Option Filter { get; } = new( + name: @"--filter") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIModelsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIModelsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-models", @"Openai Models"); + command.Options.Add(SortBy); + command.Options.Add(Filter); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sortBy = parseResult.GetValue(SortBy); + var filter = parseResult.GetValue(Filter); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.OpenaiModelsAsync( + sortBy: sortBy, + filter: filter, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsOpenrouterModelsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsOpenrouterModelsCommandApiCommand.g.cs new file mode 100644 index 00000000..ff36a858 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsOpenrouterModelsCommandApiCommand.g.cs @@ -0,0 +1,67 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsOpenrouterModelsCommandApiCommand +{ + + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenRouterModelsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenRouterModelsOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openrouter-models", @"Openrouter Models"); + + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.OpenrouterModelsAsync( + + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/ModelsPrivateModelsListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ModelsPrivateModelsListCommandApiCommand.g.cs new file mode 100644 index 00000000..a5c6bde2 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsPrivateModelsListCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class ModelsPrivateModelsListCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"private-models-list", @"Private Models List"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Models.PrivateModelsListAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OktaLoginCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OktaLoginCommandApiCommand.g.cs deleted file mode 100644 index f2f231b8..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OktaLoginCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OktaLoginCommandApiCommand -{ - private static Option TeamId { get; } = new( - name: @"--team-id") - { - Description = @"", - Required = true, - }; - - private static Option Origin { get; } = new( - name: @"--origin") - { - Description = @"", - }; - - private static Option LoginId { get; } = new( - name: @"--login-id") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"okta-login", @"Okta Login"); - command.Options.Add(TeamId); - command.Options.Add(Origin); - command.Options.Add(LoginId); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var teamId = parseResult.GetRequiredValue(TeamId); - var origin = parseResult.GetValue(Origin); - var loginId = parseResult.GetValue(LoginId); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OktaLoginAsync( - teamId: teamId, - origin: origin, - loginId: loginId, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAIBatchesInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAIBatchesInOptionSet.g.cs deleted file mode 100644 index d1010856..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAIBatchesInOptionSet.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAIBatchesInOptionSet( - Option InputFileId, - Option Endpoint, - Option CompletionWindow) -{ - public static OpenAIBatchesInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAIBatchesInOptionSet( - InputFileId: new Option($"--{normalizedPrefix}input-file-id") - { - Description = @"The ID of an uploaded file that contains requests for the new batch.", - Required = true, - }, - Endpoint: new Option($"--{normalizedPrefix}endpoint") - { - Description = @"The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported.", - Required = true, - }, - CompletionWindow: new Option($"--{normalizedPrefix}completion-window") - { - Description = @"The time frame within which the batch should be processed. Currently only 24h is supported.", - DefaultValueFactory = _ => "24h", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAIChatCompletionsInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAIChatCompletionsInOptionSet.g.cs deleted file mode 100644 index 4f3df864..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAIChatCompletionsInOptionSet.g.cs +++ /dev/null @@ -1,89 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAIChatCompletionsInOptionSet( - Option Model, - Option Stream, - Option Temperature, - Option TopP, - Option MinP, - Option TopK, - Option MaxTokens, - Option N, - Option PresencePenalty, - Option FrequencyPenalty, - Option RepetitionPenalty, - Option User, - Option Seed, - Option Logprobs, - Option PromptCacheKey) -{ - public static OpenAIChatCompletionsInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAIChatCompletionsInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"model name", - Required = true, - }, - Stream: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}stream", description: @"whether to stream the output via SSE or return the full response"), - Temperature: new Option($"--{normalizedPrefix}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", - }, - TopP: new Option($"--{normalizedPrefix}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.", - }, - MinP: new Option($"--{normalizedPrefix}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.", - }, - TopK: new Option($"--{normalizedPrefix}top-k") - { - Description = @"Sample from the best k (number of) tokens. 0 means off", - }, - MaxTokens: new Option($"--{normalizedPrefix}max-tokens") - { - Description = @"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.", - }, - N: new Option($"--{normalizedPrefix}n") - { - Description = @"number of sequences to return", - }, - PresencePenalty: new Option($"--{normalizedPrefix}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.", - }, - FrequencyPenalty: new Option($"--{normalizedPrefix}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.", - }, - RepetitionPenalty: new Option($"--{normalizedPrefix}repetition-penalty") - { - Description = @"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)", - }, - User: new Option($"--{normalizedPrefix}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: new Option($"--{normalizedPrefix}seed") - { - Description = @"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed.", - }, - Logprobs: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}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`."), - PromptCacheKey: new Option($"--{normalizedPrefix}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.", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAICompletionsInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAICompletionsInOptionSet.g.cs deleted file mode 100644 index b3a9bfd6..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAICompletionsInOptionSet.g.cs +++ /dev/null @@ -1,96 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAICompletionsInOptionSet( - Option Model, - Option MaxTokens, - Option Temperature, - Option TopP, - Option MinP, - Option TopK, - Option N, - Option Stream, - Option Logprobs, - Option Echo, - Option PresencePenalty, - Option FrequencyPenalty, - Option RepetitionPenalty, - Option User, - Option Seed, - Option ReturnTokensAsTokenIds, - Option PromptCacheKey) -{ - public static OpenAICompletionsInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAICompletionsInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"model name", - Required = true, - }, - MaxTokens: new Option($"--{normalizedPrefix}max-tokens") - { - Description = @"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.", - }, - Temperature: new Option($"--{normalizedPrefix}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", - }, - TopP: new Option($"--{normalizedPrefix}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.", - }, - MinP: new Option($"--{normalizedPrefix}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.", - }, - TopK: new Option($"--{normalizedPrefix}top-k") - { - Description = @"Sample from the best k (number of) tokens. 0 means off", - }, - N: new Option($"--{normalizedPrefix}n") - { - Description = @"number of sequences to return", - }, - Stream: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}stream", description: @"whether to stream the output via SSE or return the full response"), - Logprobs: new Option($"--{normalizedPrefix}logprobs") - { - Description = @"return top tokens and their log-probabilities", - }, - Echo: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}echo", description: @"return prompt as part of the respons"), - PresencePenalty: new Option($"--{normalizedPrefix}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.", - }, - FrequencyPenalty: new Option($"--{normalizedPrefix}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.", - }, - RepetitionPenalty: new Option($"--{normalizedPrefix}repetition-penalty") - { - Description = @"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)", - }, - User: new Option($"--{normalizedPrefix}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: new Option($"--{normalizedPrefix}seed") - { - Description = @"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed.", - }, - ReturnTokensAsTokenIds: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}return-tokens-as-token-ids", description: @"return tokens as token ids"), - PromptCacheKey: new Option($"--{normalizedPrefix}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.", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAIEmbeddingsInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAIEmbeddingsInOptionSet.g.cs deleted file mode 100644 index 79344fff..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAIEmbeddingsInOptionSet.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAIEmbeddingsInOptionSet( - Option Model, - Option EncodingFormat, - Option Dimensions) -{ - public static OpenAIEmbeddingsInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAIEmbeddingsInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"model name", - Required = true, - }, - EncodingFormat: new Option($"--{normalizedPrefix}encoding-format") - { - Description = @"format used when encoding", - }, - Dimensions: new Option($"--{normalizedPrefix}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.", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAIImagesEditsInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAIImagesEditsInOptionSet.g.cs deleted file mode 100644 index a6f5c8fa..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAIImagesEditsInOptionSet.g.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAIImagesEditsInOptionSet( - Option Model, - Option N, - Option Size, - Option User, - Option Imagename, - Option Prompt, - Option Maskname) -{ - public static OpenAIImagesEditsInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAIImagesEditsInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"The model to use.", - Required = true, - }, - N: new Option($"--{normalizedPrefix}n") - { - Description = @"The number of images to generate.", - }, - Size: new Option($"--{normalizedPrefix}size") - { - Description = @"The size of the generated images. Available sizes depend on the model.", - }, - User: new Option($"--{normalizedPrefix}user") - { - Description = @"A unique identifier representing your end-user, which can help to monitor and detect abuse.", - }, - Imagename: new Option($"--{normalizedPrefix}imagename") - { - Description = @"Input image bytes for editing task", - Required = true, - }, - Prompt: new Option($"--{normalizedPrefix}prompt") - { - Description = @"A text description of the desired image edits.", - Required = true, - }, - Maskname: new Option($"--{normalizedPrefix}maskname") - { - 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.", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAIImagesGenerationsInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAIImagesGenerationsInOptionSet.g.cs deleted file mode 100644 index 9bfb5052..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAIImagesGenerationsInOptionSet.g.cs +++ /dev/null @@ -1,54 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAIImagesGenerationsInOptionSet( - Option Model, - Option N, - Option Size, - Option User, - Option Prompt, - Option Quality, - Option Style) -{ - public static OpenAIImagesGenerationsInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAIImagesGenerationsInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"The model to use for image generation.", - Required = true, - }, - N: new Option($"--{normalizedPrefix}n") - { - Description = @"The number of images to generate.", - }, - Size: new Option($"--{normalizedPrefix}size") - { - Description = @"The size of the generated images. Available sizes depend on the model.", - }, - User: new Option($"--{normalizedPrefix}user") - { - Description = @"A unique identifier representing your end-user, which can help to monitor and detect abuse.", - }, - Prompt: new Option($"--{normalizedPrefix}prompt") - { - Description = @"A text description of desired image(s).", - Required = true, - }, - Quality: new Option($"--{normalizedPrefix}quality") - { - Description = @"The quality of the image that will be generated.", - }, - Style: new Option($"--{normalizedPrefix}style") - { - Description = @"The style of the generated images.", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAIImagesVariationsInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAIImagesVariationsInOptionSet.g.cs deleted file mode 100644 index f2ac50d4..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAIImagesVariationsInOptionSet.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAIImagesVariationsInOptionSet( - Option Model, - Option N, - Option Size, - Option User, - Option Imagename) -{ - public static OpenAIImagesVariationsInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAIImagesVariationsInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"The model to use.", - Required = true, - }, - N: new Option($"--{normalizedPrefix}n") - { - Description = @"The number of images to generate.", - }, - Size: new Option($"--{normalizedPrefix}size") - { - Description = @"The size of the generated images. Available sizes depend on the model.", - }, - User: new Option($"--{normalizedPrefix}user") - { - Description = @"A unique identifier representing your end-user, which can help to monitor and detect abuse.", - }, - Imagename: new Option($"--{normalizedPrefix}imagename") - { - Description = @"Input image bytes for variation task", - Required = true, - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenAITextToSpeechInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenAITextToSpeechInOptionSet.g.cs deleted file mode 100644 index b1aa1be7..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenAITextToSpeechInOptionSet.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal sealed record OpenAITextToSpeechInOptionSet( - Option Model, - Option InputOption, - Option Voice, - Option ResponseFormat, - Option Speed) -{ - public static OpenAITextToSpeechInOptionSet Create(string? prefix = null) - { - var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) - ? string.Empty - : prefix.Trim().Trim('-') + "-"; - return new OpenAITextToSpeechInOptionSet( - Model: new Option($"--{normalizedPrefix}model") - { - Description = @"model name", - Required = true, - }, - InputOption: new Option($"--{normalizedPrefix}input") - { - Description = @"Text to convert to speech", - Required = true, - }, - Voice: new Option($"--{normalizedPrefix}voice") - { - Description = @"Preset voices to use for the speech.", - }, - ResponseFormat: new Option($"--{normalizedPrefix}response-format") - { - Description = @"response format for the speech", - }, - Speed: new Option($"--{normalizedPrefix}speed") - { - Description = @"speed of the speech", - } - ); - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioSpeech2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiAudioSpeech2CommandApiCommand.g.cs deleted file mode 100644 index 6eeb4801..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioSpeech2CommandApiCommand.g.cs +++ /dev/null @@ -1,140 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiAudioSpeech2CommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ServiceTier { get; } = new( - name: @"--service-tier") - { - 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).", - }; - - private static Option ExtraBody { get; } = new( - name: @"--extra-body") - { - Description = @"Extra body parameters for the model.", - }; - private static readonly OpenAITextToSpeechInOptionSet OpenAITextToSpeechInOptionSetOptions = OpenAITextToSpeechInOptionSet.Create(); - private static Option RequestInput { get; } = new(@"--request-input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-audio-speech2", @"Openai Audio Speech"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(ServiceTier); - command.Options.Add(ExtraBody); command.Options.Add(OpenAITextToSpeechInOptionSetOptions.Model); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.InputOption); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.Voice); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.ResponseFormat); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.Speed); - command.Options.Add(RequestInput); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(RequestInput) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --request-input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - RequestInput, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); - var extraBody = CliRuntime.WasSpecified(parseResult, ExtraBody) ? parseResult.GetValue(ExtraBody) : (__requestBase is { } __ExtraBodyBaseValue ? __ExtraBodyBaseValue.ExtraBody : default); var model = parseResult.GetRequiredValue(OpenAITextToSpeechInOptionSetOptions.Model); - var input = parseResult.GetRequiredValue(OpenAITextToSpeechInOptionSetOptions.InputOption); - var voice = CliRuntime.WasSpecified(parseResult, OpenAITextToSpeechInOptionSetOptions.Voice) ? parseResult.GetValue(OpenAITextToSpeechInOptionSetOptions.Voice) : (__requestBase is { } __VoiceBaseValue ? __VoiceBaseValue.Voice : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, OpenAITextToSpeechInOptionSetOptions.ResponseFormat) ? parseResult.GetValue(OpenAITextToSpeechInOptionSetOptions.ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var speed = CliRuntime.WasSpecified(parseResult, OpenAITextToSpeechInOptionSetOptions.Speed) ? parseResult.GetValue(OpenAITextToSpeechInOptionSetOptions.Speed) : (__requestBase is { } __SpeedBaseValue ? __SpeedBaseValue.Speed : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiAudioSpeech2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - serviceTier: serviceTier, - extraBody: extraBody, - model: model, - input: input, - voice: voice, - responseFormat: responseFormat, - speed: speed, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioSpeechCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiAudioSpeechCommandApiCommand.g.cs deleted file mode 100644 index 51853a24..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioSpeechCommandApiCommand.g.cs +++ /dev/null @@ -1,140 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiAudioSpeechCommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ServiceTier { get; } = new( - name: @"--service-tier") - { - 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).", - }; - - private static Option ExtraBody { get; } = new( - name: @"--extra-body") - { - Description = @"Extra body parameters for the model.", - }; - private static readonly OpenAITextToSpeechInOptionSet OpenAITextToSpeechInOptionSetOptions = OpenAITextToSpeechInOptionSet.Create(); - private static Option RequestInput { get; } = new(@"--request-input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-audio-speech", @"Openai Audio Speech"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(ServiceTier); - command.Options.Add(ExtraBody); command.Options.Add(OpenAITextToSpeechInOptionSetOptions.Model); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.InputOption); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.Voice); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.ResponseFormat); - command.Options.Add(OpenAITextToSpeechInOptionSetOptions.Speed); - command.Options.Add(RequestInput); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(RequestInput) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --request-input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - RequestInput, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); - var extraBody = CliRuntime.WasSpecified(parseResult, ExtraBody) ? parseResult.GetValue(ExtraBody) : (__requestBase is { } __ExtraBodyBaseValue ? __ExtraBodyBaseValue.ExtraBody : default); var model = parseResult.GetRequiredValue(OpenAITextToSpeechInOptionSetOptions.Model); - var input = parseResult.GetRequiredValue(OpenAITextToSpeechInOptionSetOptions.InputOption); - var voice = CliRuntime.WasSpecified(parseResult, OpenAITextToSpeechInOptionSetOptions.Voice) ? parseResult.GetValue(OpenAITextToSpeechInOptionSetOptions.Voice) : (__requestBase is { } __VoiceBaseValue ? __VoiceBaseValue.Voice : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, OpenAITextToSpeechInOptionSetOptions.ResponseFormat) ? parseResult.GetValue(OpenAITextToSpeechInOptionSetOptions.ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var speed = CliRuntime.WasSpecified(parseResult, OpenAITextToSpeechInOptionSetOptions.Speed) ? parseResult.GetValue(OpenAITextToSpeechInOptionSetOptions.Speed) : (__requestBase is { } __SpeedBaseValue ? __SpeedBaseValue.Speed : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiAudioSpeechAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - serviceTier: serviceTier, - extraBody: extraBody, - model: model, - input: input, - voice: voice, - responseFormat: responseFormat, - speed: speed, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranscriptions2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranscriptions2CommandApiCommand.g.cs deleted file mode 100644 index 393c4537..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranscriptions2CommandApiCommand.g.cs +++ /dev/null @@ -1,183 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiAudioTranscriptions2CommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option File { get; } = new( - name: @"--file") - { - Description = @"", - Required = true, - }; - - private static Option Filename { get; } = new( - name: @"--filename") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - - private static Option Language { get; } = new( - name: @"--language") - { - Description = @"", - }; - - private static Option Prompt { get; } = new( - name: @"--prompt") - { - Description = @"", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"", - }; - - private static Option Temperature { get; } = new( - name: @"--temperature") - { - Description = @"", - }; - - private static Option?> TimestampGranularities { get; } = new( - name: @"--timestamp-granularities") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-audio-transcriptions2", @"Openai Audio Transcriptions"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(File); - command.Options.Add(Filename); - command.Options.Add(Model); - command.Options.Add(Language); - command.Options.Add(Prompt); - command.Options.Add(ResponseFormat); - command.Options.Add(Temperature); - command.Options.Add(TimestampGranularities); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var file = parseResult.GetRequiredValue(File); - var filename = parseResult.GetRequiredValue(Filename); - var model = parseResult.GetRequiredValue(Model); - var language = CliRuntime.WasSpecified(parseResult, Language) ? parseResult.GetValue(Language) : (__requestBase is { } __LanguageBaseValue ? __LanguageBaseValue.Language : default); - var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var timestampGranularities = CliRuntime.WasSpecified(parseResult, TimestampGranularities) ? parseResult.GetValue(TimestampGranularities) : (__requestBase is { } __TimestampGranularitiesBaseValue ? __TimestampGranularitiesBaseValue.TimestampGranularities : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiAudioTranscriptions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - file: file, - filename: filename, - model: model, - language: language, - prompt: prompt, - responseFormat: responseFormat, - temperature: temperature, - timestampGranularities: timestampGranularities, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranscriptionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranscriptionsCommandApiCommand.g.cs deleted file mode 100644 index 1ed7e637..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranscriptionsCommandApiCommand.g.cs +++ /dev/null @@ -1,183 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiAudioTranscriptionsCommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option File { get; } = new( - name: @"--file") - { - Description = @"", - Required = true, - }; - - private static Option Filename { get; } = new( - name: @"--filename") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - - private static Option Language { get; } = new( - name: @"--language") - { - Description = @"", - }; - - private static Option Prompt { get; } = new( - name: @"--prompt") - { - Description = @"", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"", - }; - - private static Option Temperature { get; } = new( - name: @"--temperature") - { - Description = @"", - }; - - private static Option?> TimestampGranularities { get; } = new( - name: @"--timestamp-granularities") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-audio-transcriptions", @"Openai Audio Transcriptions"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(File); - command.Options.Add(Filename); - command.Options.Add(Model); - command.Options.Add(Language); - command.Options.Add(Prompt); - command.Options.Add(ResponseFormat); - command.Options.Add(Temperature); - command.Options.Add(TimestampGranularities); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var file = parseResult.GetRequiredValue(File); - var filename = parseResult.GetRequiredValue(Filename); - var model = parseResult.GetRequiredValue(Model); - var language = CliRuntime.WasSpecified(parseResult, Language) ? parseResult.GetValue(Language) : (__requestBase is { } __LanguageBaseValue ? __LanguageBaseValue.Language : default); - var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var timestampGranularities = CliRuntime.WasSpecified(parseResult, TimestampGranularities) ? parseResult.GetValue(TimestampGranularities) : (__requestBase is { } __TimestampGranularitiesBaseValue ? __TimestampGranularitiesBaseValue.TimestampGranularities : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiAudioTranscriptionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - file: file, - filename: filename, - model: model, - language: language, - prompt: prompt, - responseFormat: responseFormat, - temperature: temperature, - timestampGranularities: timestampGranularities, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranslations2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranslations2CommandApiCommand.g.cs deleted file mode 100644 index f05286cf..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranslations2CommandApiCommand.g.cs +++ /dev/null @@ -1,165 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiAudioTranslations2CommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option File { get; } = new( - name: @"--file") - { - Description = @"", - Required = true, - }; - - private static Option Filename { get; } = new( - name: @"--filename") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - - private static Option Prompt { get; } = new( - name: @"--prompt") - { - Description = @"", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"", - }; - - private static Option Temperature { get; } = new( - name: @"--temperature") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-audio-translations2", @"Openai Audio Translations"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(File); - command.Options.Add(Filename); - command.Options.Add(Model); - command.Options.Add(Prompt); - command.Options.Add(ResponseFormat); - command.Options.Add(Temperature); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var file = parseResult.GetRequiredValue(File); - var filename = parseResult.GetRequiredValue(Filename); - var model = parseResult.GetRequiredValue(Model); - var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiAudioTranslations2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - file: file, - filename: filename, - model: model, - prompt: prompt, - responseFormat: responseFormat, - temperature: temperature, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranslationsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranslationsCommandApiCommand.g.cs deleted file mode 100644 index ce4e8fa6..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiAudioTranslationsCommandApiCommand.g.cs +++ /dev/null @@ -1,165 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiAudioTranslationsCommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option File { get; } = new( - name: @"--file") - { - Description = @"", - Required = true, - }; - - private static Option Filename { get; } = new( - name: @"--filename") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - - private static Option Prompt { get; } = new( - name: @"--prompt") - { - Description = @"", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"", - }; - - private static Option Temperature { get; } = new( - name: @"--temperature") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-audio-translations", @"Openai Audio Translations"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(File); - command.Options.Add(Filename); - command.Options.Add(Model); - command.Options.Add(Prompt); - command.Options.Add(ResponseFormat); - command.Options.Add(Temperature); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var file = parseResult.GetRequiredValue(File); - var filename = parseResult.GetRequiredValue(Filename); - var model = parseResult.GetRequiredValue(Model); - var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiAudioTranslationsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - file: file, - filename: filename, - model: model, - prompt: prompt, - responseFormat: responseFormat, - temperature: temperature, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiChatCompletions2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiChatCompletions2CommandApiCommand.g.cs deleted file mode 100644 index 37054566..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiChatCompletions2CommandApiCommand.g.cs +++ /dev/null @@ -1,247 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiChatCompletions2CommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option>> Messages { get; } = new( - name: @"--messages") - { - Description = @"conversation messages: (user,assistant,tool)*,user including one system message anywhere", - Required = true, - }; - - private static Option, object>?> Stop { get; } = new( - name: @"--stop") - { - Description = @"up to 16 sequences where the API will stop generating further tokens", - }; - - private static Option?> Tools { get; } = new( - name: @"--tools") - { - Description = @"A list of tools the model may call. Currently, only functions are supported as a tool.", - }; - - private static Option?> ToolChoice { get; } = new( - name: @"--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.", - }; - - private static Option?> ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format of the response. Currently, only json is supported.", - }; - - private static Option ReasoningEffort { get; } = new( - name: @"--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.", - }; - - private static Option ChatTemplateKwargs { get; } = new( - name: @"--chat-template-kwargs") - { - Description = @"Chat template kwargs.", - }; - private static readonly OpenAIChatCompletionsInOptionSet OpenAIChatCompletionsInOptionSetOptions = OpenAIChatCompletionsInOptionSet.Create(); - - private static readonly StreamOptionsOptionSet StreamOptionsOptions = StreamOptionsOptionSet.Create(@"stream"); - - private static readonly ChatReasoningSettingsOptionSet ReasoningOptions = ChatReasoningSettingsOptionSet.Create(@"reasoning"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-chat-completions2", @"Openai Chat Completions"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(Messages); - command.Options.Add(Stop); - command.Options.Add(Tools); - command.Options.Add(ToolChoice); - command.Options.Add(ResponseFormat); - command.Options.Add(ReasoningEffort); - command.Options.Add(ChatTemplateKwargs); command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Model); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Stream); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Temperature); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.TopP); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.MinP); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.TopK); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.MaxTokens); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.N); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.PresencePenalty); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.FrequencyPenalty); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.RepetitionPenalty); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.User); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Seed); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Logprobs); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.PromptCacheKey); command.Options.Add(StreamOptionsOptions.IncludeUsage); - command.Options.Add(StreamOptionsOptions.ContinuousUsageStats); command.Options.Add(ReasoningOptions.Enabled); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var messages = parseResult.GetRequiredValue(Messages); - var stop = CliRuntime.WasSpecified(parseResult, Stop) ? parseResult.GetValue(Stop) : (__requestBase is { } __StopBaseValue ? __StopBaseValue.Stop : default); - var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); - var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var reasoningEffort = CliRuntime.WasSpecified(parseResult, ReasoningEffort) ? parseResult.GetValue(ReasoningEffort) : (__requestBase is { } __ReasoningEffortBaseValue ? __ReasoningEffortBaseValue.ReasoningEffort : default); - var chatTemplateKwargs = CliRuntime.WasSpecified(parseResult, ChatTemplateKwargs) ? parseResult.GetValue(ChatTemplateKwargs) : (__requestBase is { } __ChatTemplateKwargsBaseValue ? __ChatTemplateKwargsBaseValue.ChatTemplateKwargs : default); var model = parseResult.GetRequiredValue(OpenAIChatCompletionsInOptionSetOptions.Model); - var stream = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Stream) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); - var temperature = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Temperature) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var topP = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.TopP) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); - var minP = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.MinP) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.MinP) : (__requestBase is { } __MinPBaseValue ? __MinPBaseValue.MinP : default); - var topK = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.TopK) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); - var maxTokens = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.MaxTokens) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); - var n = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.N) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var presencePenalty = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.PresencePenalty) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.PresencePenalty) : (__requestBase is { } __PresencePenaltyBaseValue ? __PresencePenaltyBaseValue.PresencePenalty : default); - var frequencyPenalty = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.FrequencyPenalty) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.FrequencyPenalty) : (__requestBase is { } __FrequencyPenaltyBaseValue ? __FrequencyPenaltyBaseValue.FrequencyPenalty : default); - var repetitionPenalty = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.RepetitionPenalty) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.RepetitionPenalty) : (__requestBase is { } __RepetitionPenaltyBaseValue ? __RepetitionPenaltyBaseValue.RepetitionPenalty : default); - var user = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.User) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - var seed = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Seed) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); - var logprobs = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Logprobs) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Logprobs) : (__requestBase is { } __LogprobsBaseValue ? __LogprobsBaseValue.Logprobs : default); - var promptCacheKey = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.PromptCacheKey) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); - - var __StreamOptionsBase = __requestBase is { } __StreamOptionsBaseValue ? __StreamOptionsBaseValue.StreamOptions : default; var streamOptionsIncludeUsage = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) ? parseResult.GetValue(StreamOptionsOptions.IncludeUsage) : (__StreamOptionsBase is { } __StreamOptionsincludeUsageBaseValue ? __StreamOptionsincludeUsageBaseValue.IncludeUsage : default); - var streamOptionsContinuousUsageStats = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats) ? parseResult.GetValue(StreamOptionsOptions.ContinuousUsageStats) : (__StreamOptionsBase is { } __StreamOptionscontinuousUsageStatsBaseValue ? __StreamOptionscontinuousUsageStatsBaseValue.ContinuousUsageStats : default); - var __StreamOptionsSpecified = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) || CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats); - var streamOptions = - __StreamOptionsSpecified || __StreamOptionsBase is not null - ? new global::DeepInfra.StreamOptions - { - IncludeUsage = streamOptionsIncludeUsage, - ContinuousUsageStats = streamOptionsContinuousUsageStats, - - } - : __StreamOptionsBase; - - var __ReasoningBase = __requestBase is { } __ReasoningBaseValue ? __ReasoningBaseValue.Reasoning : default; var reasoningEnabled = CliRuntime.WasSpecified(parseResult, ReasoningOptions.Enabled) ? parseResult.GetValue(ReasoningOptions.Enabled) : (__ReasoningBase is { } __ReasoningenabledBaseValue ? __ReasoningenabledBaseValue.Enabled : default); - var __ReasoningSpecified = CliRuntime.WasSpecified(parseResult, ReasoningOptions.Enabled); - var reasoning = - __ReasoningSpecified || __ReasoningBase is not null - ? new global::DeepInfra.ChatReasoningSettings - { - Enabled = reasoningEnabled, - - } - : __ReasoningBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiChatCompletions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - messages: messages, - stop: stop, - tools: tools, - toolChoice: toolChoice, - responseFormat: responseFormat, - reasoningEffort: reasoningEffort, - chatTemplateKwargs: chatTemplateKwargs, - model: model, - stream: stream, - temperature: temperature, - topP: topP, - minP: minP, - topK: topK, - maxTokens: maxTokens, - n: n, - presencePenalty: presencePenalty, - frequencyPenalty: frequencyPenalty, - repetitionPenalty: repetitionPenalty, - user: user, - seed: seed, - logprobs: logprobs, - promptCacheKey: promptCacheKey, - streamOptions: streamOptions, - reasoning: reasoning, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiChatCompletionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiChatCompletionsCommandApiCommand.g.cs deleted file mode 100644 index c30c1f30..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiChatCompletionsCommandApiCommand.g.cs +++ /dev/null @@ -1,247 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiChatCompletionsCommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option>> Messages { get; } = new( - name: @"--messages") - { - Description = @"conversation messages: (user,assistant,tool)*,user including one system message anywhere", - Required = true, - }; - - private static Option, object>?> Stop { get; } = new( - name: @"--stop") - { - Description = @"up to 16 sequences where the API will stop generating further tokens", - }; - - private static Option?> Tools { get; } = new( - name: @"--tools") - { - Description = @"A list of tools the model may call. Currently, only functions are supported as a tool.", - }; - - private static Option?> ToolChoice { get; } = new( - name: @"--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.", - }; - - private static Option?> ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format of the response. Currently, only json is supported.", - }; - - private static Option ReasoningEffort { get; } = new( - name: @"--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.", - }; - - private static Option ChatTemplateKwargs { get; } = new( - name: @"--chat-template-kwargs") - { - Description = @"Chat template kwargs.", - }; - private static readonly OpenAIChatCompletionsInOptionSet OpenAIChatCompletionsInOptionSetOptions = OpenAIChatCompletionsInOptionSet.Create(); - - private static readonly StreamOptionsOptionSet StreamOptionsOptions = StreamOptionsOptionSet.Create(@"stream"); - - private static readonly ChatReasoningSettingsOptionSet ReasoningOptions = ChatReasoningSettingsOptionSet.Create(@"reasoning"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-chat-completions", @"Openai Chat Completions"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(Messages); - command.Options.Add(Stop); - command.Options.Add(Tools); - command.Options.Add(ToolChoice); - command.Options.Add(ResponseFormat); - command.Options.Add(ReasoningEffort); - command.Options.Add(ChatTemplateKwargs); command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Model); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Stream); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Temperature); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.TopP); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.MinP); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.TopK); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.MaxTokens); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.N); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.PresencePenalty); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.FrequencyPenalty); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.RepetitionPenalty); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.User); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Seed); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.Logprobs); - command.Options.Add(OpenAIChatCompletionsInOptionSetOptions.PromptCacheKey); command.Options.Add(StreamOptionsOptions.IncludeUsage); - command.Options.Add(StreamOptionsOptions.ContinuousUsageStats); command.Options.Add(ReasoningOptions.Enabled); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var messages = parseResult.GetRequiredValue(Messages); - var stop = CliRuntime.WasSpecified(parseResult, Stop) ? parseResult.GetValue(Stop) : (__requestBase is { } __StopBaseValue ? __StopBaseValue.Stop : default); - var tools = CliRuntime.WasSpecified(parseResult, Tools) ? parseResult.GetValue(Tools) : (__requestBase is { } __ToolsBaseValue ? __ToolsBaseValue.Tools : default); - var toolChoice = CliRuntime.WasSpecified(parseResult, ToolChoice) ? parseResult.GetValue(ToolChoice) : (__requestBase is { } __ToolChoiceBaseValue ? __ToolChoiceBaseValue.ToolChoice : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var reasoningEffort = CliRuntime.WasSpecified(parseResult, ReasoningEffort) ? parseResult.GetValue(ReasoningEffort) : (__requestBase is { } __ReasoningEffortBaseValue ? __ReasoningEffortBaseValue.ReasoningEffort : default); - var chatTemplateKwargs = CliRuntime.WasSpecified(parseResult, ChatTemplateKwargs) ? parseResult.GetValue(ChatTemplateKwargs) : (__requestBase is { } __ChatTemplateKwargsBaseValue ? __ChatTemplateKwargsBaseValue.ChatTemplateKwargs : default); var model = parseResult.GetRequiredValue(OpenAIChatCompletionsInOptionSetOptions.Model); - var stream = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Stream) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); - var temperature = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Temperature) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var topP = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.TopP) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); - var minP = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.MinP) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.MinP) : (__requestBase is { } __MinPBaseValue ? __MinPBaseValue.MinP : default); - var topK = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.TopK) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); - var maxTokens = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.MaxTokens) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); - var n = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.N) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var presencePenalty = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.PresencePenalty) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.PresencePenalty) : (__requestBase is { } __PresencePenaltyBaseValue ? __PresencePenaltyBaseValue.PresencePenalty : default); - var frequencyPenalty = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.FrequencyPenalty) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.FrequencyPenalty) : (__requestBase is { } __FrequencyPenaltyBaseValue ? __FrequencyPenaltyBaseValue.FrequencyPenalty : default); - var repetitionPenalty = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.RepetitionPenalty) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.RepetitionPenalty) : (__requestBase is { } __RepetitionPenaltyBaseValue ? __RepetitionPenaltyBaseValue.RepetitionPenalty : default); - var user = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.User) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - var seed = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Seed) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); - var logprobs = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.Logprobs) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.Logprobs) : (__requestBase is { } __LogprobsBaseValue ? __LogprobsBaseValue.Logprobs : default); - var promptCacheKey = CliRuntime.WasSpecified(parseResult, OpenAIChatCompletionsInOptionSetOptions.PromptCacheKey) ? parseResult.GetValue(OpenAIChatCompletionsInOptionSetOptions.PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); - - var __StreamOptionsBase = __requestBase is { } __StreamOptionsBaseValue ? __StreamOptionsBaseValue.StreamOptions : default; var streamOptionsIncludeUsage = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) ? parseResult.GetValue(StreamOptionsOptions.IncludeUsage) : (__StreamOptionsBase is { } __StreamOptionsincludeUsageBaseValue ? __StreamOptionsincludeUsageBaseValue.IncludeUsage : default); - var streamOptionsContinuousUsageStats = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats) ? parseResult.GetValue(StreamOptionsOptions.ContinuousUsageStats) : (__StreamOptionsBase is { } __StreamOptionscontinuousUsageStatsBaseValue ? __StreamOptionscontinuousUsageStatsBaseValue.ContinuousUsageStats : default); - var __StreamOptionsSpecified = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) || CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats); - var streamOptions = - __StreamOptionsSpecified || __StreamOptionsBase is not null - ? new global::DeepInfra.StreamOptions - { - IncludeUsage = streamOptionsIncludeUsage, - ContinuousUsageStats = streamOptionsContinuousUsageStats, - - } - : __StreamOptionsBase; - - var __ReasoningBase = __requestBase is { } __ReasoningBaseValue ? __ReasoningBaseValue.Reasoning : default; var reasoningEnabled = CliRuntime.WasSpecified(parseResult, ReasoningOptions.Enabled) ? parseResult.GetValue(ReasoningOptions.Enabled) : (__ReasoningBase is { } __ReasoningenabledBaseValue ? __ReasoningenabledBaseValue.Enabled : default); - var __ReasoningSpecified = CliRuntime.WasSpecified(parseResult, ReasoningOptions.Enabled); - var reasoning = - __ReasoningSpecified || __ReasoningBase is not null - ? new global::DeepInfra.ChatReasoningSettings - { - Enabled = reasoningEnabled, - - } - : __ReasoningBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiChatCompletionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - messages: messages, - stop: stop, - tools: tools, - toolChoice: toolChoice, - responseFormat: responseFormat, - reasoningEffort: reasoningEffort, - chatTemplateKwargs: chatTemplateKwargs, - model: model, - stream: stream, - temperature: temperature, - topP: topP, - minP: minP, - topK: topK, - maxTokens: maxTokens, - n: n, - presencePenalty: presencePenalty, - frequencyPenalty: frequencyPenalty, - repetitionPenalty: repetitionPenalty, - user: user, - seed: seed, - logprobs: logprobs, - promptCacheKey: promptCacheKey, - streamOptions: streamOptions, - reasoning: reasoning, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiCompletions2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiCompletions2CommandApiCommand.g.cs deleted file mode 100644 index ecd4f994..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiCompletions2CommandApiCommand.g.cs +++ /dev/null @@ -1,226 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiCompletions2CommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option>> Prompt { get; } = new( - name: @"--prompt") - { - Description = @"input prompt - a single string is currently supported", - Required = true, - }; - - private static Option, object>?> Stop { get; } = new( - name: @"--stop") - { - Description = @"up to 16 sequences where the API will stop generating further tokens", - }; - - private static Option?> ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format of the response. Currently, only json is supported.", - }; - - private static Option?> StopTokenIds { get; } = new( - name: @"--stop-token-ids") - { - Description = @"List of token IDs that will stop generation when encountered", - }; - private static readonly OpenAICompletionsInOptionSet OpenAICompletionsInOptionSetOptions = OpenAICompletionsInOptionSet.Create(); - - private static readonly StreamOptionsOptionSet StreamOptionsOptions = StreamOptionsOptionSet.Create(@"stream"); - - private static readonly CompletionMultiModalDataOptionSet DataOptions = CompletionMultiModalDataOptionSet.Create(@"data"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-completions2", @"Openai Completions"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(Prompt); - command.Options.Add(Stop); - command.Options.Add(ResponseFormat); - command.Options.Add(StopTokenIds); command.Options.Add(OpenAICompletionsInOptionSetOptions.Model); - command.Options.Add(OpenAICompletionsInOptionSetOptions.MaxTokens); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Temperature); - command.Options.Add(OpenAICompletionsInOptionSetOptions.TopP); - command.Options.Add(OpenAICompletionsInOptionSetOptions.MinP); - command.Options.Add(OpenAICompletionsInOptionSetOptions.TopK); - command.Options.Add(OpenAICompletionsInOptionSetOptions.N); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Stream); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Logprobs); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Echo); - command.Options.Add(OpenAICompletionsInOptionSetOptions.PresencePenalty); - command.Options.Add(OpenAICompletionsInOptionSetOptions.FrequencyPenalty); - command.Options.Add(OpenAICompletionsInOptionSetOptions.RepetitionPenalty); - command.Options.Add(OpenAICompletionsInOptionSetOptions.User); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Seed); - command.Options.Add(OpenAICompletionsInOptionSetOptions.ReturnTokensAsTokenIds); - command.Options.Add(OpenAICompletionsInOptionSetOptions.PromptCacheKey); command.Options.Add(StreamOptionsOptions.IncludeUsage); - command.Options.Add(StreamOptionsOptions.ContinuousUsageStats); command.Options.Add(DataOptions.Image); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var prompt = parseResult.GetRequiredValue(Prompt); - var stop = CliRuntime.WasSpecified(parseResult, Stop) ? parseResult.GetValue(Stop) : (__requestBase is { } __StopBaseValue ? __StopBaseValue.Stop : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var stopTokenIds = CliRuntime.WasSpecified(parseResult, StopTokenIds) ? parseResult.GetValue(StopTokenIds) : (__requestBase is { } __StopTokenIdsBaseValue ? __StopTokenIdsBaseValue.StopTokenIds : default); var model = parseResult.GetRequiredValue(OpenAICompletionsInOptionSetOptions.Model); - var maxTokens = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.MaxTokens) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); - var temperature = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Temperature) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var topP = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.TopP) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); - var minP = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.MinP) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.MinP) : (__requestBase is { } __MinPBaseValue ? __MinPBaseValue.MinP : default); - var topK = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.TopK) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); - var n = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.N) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var stream = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Stream) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); - var logprobs = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Logprobs) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Logprobs) : (__requestBase is { } __LogprobsBaseValue ? __LogprobsBaseValue.Logprobs : default); - var echo = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Echo) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Echo) : (__requestBase is { } __EchoBaseValue ? __EchoBaseValue.Echo : default); - var presencePenalty = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.PresencePenalty) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.PresencePenalty) : (__requestBase is { } __PresencePenaltyBaseValue ? __PresencePenaltyBaseValue.PresencePenalty : default); - var frequencyPenalty = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.FrequencyPenalty) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.FrequencyPenalty) : (__requestBase is { } __FrequencyPenaltyBaseValue ? __FrequencyPenaltyBaseValue.FrequencyPenalty : default); - var repetitionPenalty = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.RepetitionPenalty) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.RepetitionPenalty) : (__requestBase is { } __RepetitionPenaltyBaseValue ? __RepetitionPenaltyBaseValue.RepetitionPenalty : default); - var user = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.User) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - var seed = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Seed) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); - var returnTokensAsTokenIds = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.ReturnTokensAsTokenIds) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.ReturnTokensAsTokenIds) : (__requestBase is { } __ReturnTokensAsTokenIdsBaseValue ? __ReturnTokensAsTokenIdsBaseValue.ReturnTokensAsTokenIds : default); - var promptCacheKey = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.PromptCacheKey) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); - - var __StreamOptionsBase = __requestBase is { } __StreamOptionsBaseValue ? __StreamOptionsBaseValue.StreamOptions : default; var streamOptionsIncludeUsage = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) ? parseResult.GetValue(StreamOptionsOptions.IncludeUsage) : (__StreamOptionsBase is { } __StreamOptionsincludeUsageBaseValue ? __StreamOptionsincludeUsageBaseValue.IncludeUsage : default); - var streamOptionsContinuousUsageStats = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats) ? parseResult.GetValue(StreamOptionsOptions.ContinuousUsageStats) : (__StreamOptionsBase is { } __StreamOptionscontinuousUsageStatsBaseValue ? __StreamOptionscontinuousUsageStatsBaseValue.ContinuousUsageStats : default); - var __StreamOptionsSpecified = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) || CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats); - var streamOptions = - __StreamOptionsSpecified || __StreamOptionsBase is not null - ? new global::DeepInfra.StreamOptions - { - IncludeUsage = streamOptionsIncludeUsage, - ContinuousUsageStats = streamOptionsContinuousUsageStats, - - } - : __StreamOptionsBase; - - var __DataBase = __requestBase is { } __DataBaseValue ? __DataBaseValue.Data : default; var dataImage = CliRuntime.WasSpecified(parseResult, DataOptions.Image) ? parseResult.GetValue(DataOptions.Image) : (__DataBase is { } __DataimageBaseValue ? __DataimageBaseValue.Image : default); - var __DataSpecified = CliRuntime.WasSpecified(parseResult, DataOptions.Image); - var data = - __DataSpecified || __DataBase is not null - ? new global::DeepInfra.CompletionMultiModalData - { - Image = dataImage, - - } - : __DataBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiCompletions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - prompt: prompt, - stop: stop, - responseFormat: responseFormat, - stopTokenIds: stopTokenIds, - model: model, - maxTokens: maxTokens, - temperature: temperature, - topP: topP, - minP: minP, - topK: topK, - n: n, - stream: stream, - logprobs: logprobs, - echo: echo, - presencePenalty: presencePenalty, - frequencyPenalty: frequencyPenalty, - repetitionPenalty: repetitionPenalty, - user: user, - seed: seed, - returnTokensAsTokenIds: returnTokensAsTokenIds, - promptCacheKey: promptCacheKey, - streamOptions: streamOptions, - data: data, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiCompletionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiCompletionsCommandApiCommand.g.cs deleted file mode 100644 index 7f03352f..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiCompletionsCommandApiCommand.g.cs +++ /dev/null @@ -1,226 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiCompletionsCommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option>> Prompt { get; } = new( - name: @"--prompt") - { - Description = @"input prompt - a single string is currently supported", - Required = true, - }; - - private static Option, object>?> Stop { get; } = new( - name: @"--stop") - { - Description = @"up to 16 sequences where the API will stop generating further tokens", - }; - - private static Option?> ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format of the response. Currently, only json is supported.", - }; - - private static Option?> StopTokenIds { get; } = new( - name: @"--stop-token-ids") - { - Description = @"List of token IDs that will stop generation when encountered", - }; - private static readonly OpenAICompletionsInOptionSet OpenAICompletionsInOptionSetOptions = OpenAICompletionsInOptionSet.Create(); - - private static readonly StreamOptionsOptionSet StreamOptionsOptions = StreamOptionsOptionSet.Create(@"stream"); - - private static readonly CompletionMultiModalDataOptionSet DataOptions = CompletionMultiModalDataOptionSet.Create(@"data"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-completions", @"Openai Completions"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(XiApiKey); - command.Options.Add(Prompt); - command.Options.Add(Stop); - command.Options.Add(ResponseFormat); - command.Options.Add(StopTokenIds); command.Options.Add(OpenAICompletionsInOptionSetOptions.Model); - command.Options.Add(OpenAICompletionsInOptionSetOptions.MaxTokens); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Temperature); - command.Options.Add(OpenAICompletionsInOptionSetOptions.TopP); - command.Options.Add(OpenAICompletionsInOptionSetOptions.MinP); - command.Options.Add(OpenAICompletionsInOptionSetOptions.TopK); - command.Options.Add(OpenAICompletionsInOptionSetOptions.N); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Stream); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Logprobs); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Echo); - command.Options.Add(OpenAICompletionsInOptionSetOptions.PresencePenalty); - command.Options.Add(OpenAICompletionsInOptionSetOptions.FrequencyPenalty); - command.Options.Add(OpenAICompletionsInOptionSetOptions.RepetitionPenalty); - command.Options.Add(OpenAICompletionsInOptionSetOptions.User); - command.Options.Add(OpenAICompletionsInOptionSetOptions.Seed); - command.Options.Add(OpenAICompletionsInOptionSetOptions.ReturnTokensAsTokenIds); - command.Options.Add(OpenAICompletionsInOptionSetOptions.PromptCacheKey); command.Options.Add(StreamOptionsOptions.IncludeUsage); - command.Options.Add(StreamOptionsOptions.ContinuousUsageStats); command.Options.Add(DataOptions.Image); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var xiApiKey = parseResult.GetValue(XiApiKey); - var prompt = parseResult.GetRequiredValue(Prompt); - var stop = CliRuntime.WasSpecified(parseResult, Stop) ? parseResult.GetValue(Stop) : (__requestBase is { } __StopBaseValue ? __StopBaseValue.Stop : default); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); - var stopTokenIds = CliRuntime.WasSpecified(parseResult, StopTokenIds) ? parseResult.GetValue(StopTokenIds) : (__requestBase is { } __StopTokenIdsBaseValue ? __StopTokenIdsBaseValue.StopTokenIds : default); var model = parseResult.GetRequiredValue(OpenAICompletionsInOptionSetOptions.Model); - var maxTokens = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.MaxTokens) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); - var temperature = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Temperature) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); - var topP = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.TopP) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); - var minP = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.MinP) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.MinP) : (__requestBase is { } __MinPBaseValue ? __MinPBaseValue.MinP : default); - var topK = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.TopK) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); - var n = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.N) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var stream = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Stream) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); - var logprobs = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Logprobs) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Logprobs) : (__requestBase is { } __LogprobsBaseValue ? __LogprobsBaseValue.Logprobs : default); - var echo = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Echo) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Echo) : (__requestBase is { } __EchoBaseValue ? __EchoBaseValue.Echo : default); - var presencePenalty = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.PresencePenalty) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.PresencePenalty) : (__requestBase is { } __PresencePenaltyBaseValue ? __PresencePenaltyBaseValue.PresencePenalty : default); - var frequencyPenalty = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.FrequencyPenalty) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.FrequencyPenalty) : (__requestBase is { } __FrequencyPenaltyBaseValue ? __FrequencyPenaltyBaseValue.FrequencyPenalty : default); - var repetitionPenalty = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.RepetitionPenalty) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.RepetitionPenalty) : (__requestBase is { } __RepetitionPenaltyBaseValue ? __RepetitionPenaltyBaseValue.RepetitionPenalty : default); - var user = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.User) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - var seed = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.Seed) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); - var returnTokensAsTokenIds = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.ReturnTokensAsTokenIds) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.ReturnTokensAsTokenIds) : (__requestBase is { } __ReturnTokensAsTokenIdsBaseValue ? __ReturnTokensAsTokenIdsBaseValue.ReturnTokensAsTokenIds : default); - var promptCacheKey = CliRuntime.WasSpecified(parseResult, OpenAICompletionsInOptionSetOptions.PromptCacheKey) ? parseResult.GetValue(OpenAICompletionsInOptionSetOptions.PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); - - var __StreamOptionsBase = __requestBase is { } __StreamOptionsBaseValue ? __StreamOptionsBaseValue.StreamOptions : default; var streamOptionsIncludeUsage = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) ? parseResult.GetValue(StreamOptionsOptions.IncludeUsage) : (__StreamOptionsBase is { } __StreamOptionsincludeUsageBaseValue ? __StreamOptionsincludeUsageBaseValue.IncludeUsage : default); - var streamOptionsContinuousUsageStats = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats) ? parseResult.GetValue(StreamOptionsOptions.ContinuousUsageStats) : (__StreamOptionsBase is { } __StreamOptionscontinuousUsageStatsBaseValue ? __StreamOptionscontinuousUsageStatsBaseValue.ContinuousUsageStats : default); - var __StreamOptionsSpecified = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) || CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats); - var streamOptions = - __StreamOptionsSpecified || __StreamOptionsBase is not null - ? new global::DeepInfra.StreamOptions - { - IncludeUsage = streamOptionsIncludeUsage, - ContinuousUsageStats = streamOptionsContinuousUsageStats, - - } - : __StreamOptionsBase; - - var __DataBase = __requestBase is { } __DataBaseValue ? __DataBaseValue.Data : default; var dataImage = CliRuntime.WasSpecified(parseResult, DataOptions.Image) ? parseResult.GetValue(DataOptions.Image) : (__DataBase is { } __DataimageBaseValue ? __DataimageBaseValue.Image : default); - var __DataSpecified = CliRuntime.WasSpecified(parseResult, DataOptions.Image); - var data = - __DataSpecified || __DataBase is not null - ? new global::DeepInfra.CompletionMultiModalData - { - Image = dataImage, - - } - : __DataBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiCompletionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - prompt: prompt, - stop: stop, - responseFormat: responseFormat, - stopTokenIds: stopTokenIds, - model: model, - maxTokens: maxTokens, - temperature: temperature, - topP: topP, - minP: minP, - topK: topK, - n: n, - stream: stream, - logprobs: logprobs, - echo: echo, - presencePenalty: presencePenalty, - frequencyPenalty: frequencyPenalty, - repetitionPenalty: repetitionPenalty, - user: user, - seed: seed, - returnTokensAsTokenIds: returnTokensAsTokenIds, - promptCacheKey: promptCacheKey, - streamOptions: streamOptions, - data: data, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiEmbeddings2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiEmbeddings2CommandApiCommand.g.cs deleted file mode 100644 index 353cb8fa..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiEmbeddings2CommandApiCommand.g.cs +++ /dev/null @@ -1,144 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiEmbeddings2CommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option UserAgent { get; } = new( - name: @"--user-agent") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ServiceTier { get; } = new( - name: @"--service-tier") - { - 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).", - }; - - private static Option, string>> InputOption { get; } = new( - name: @"--input") - { - Description = @"sequences to embed", - Required = true, - }; - private static readonly OpenAIEmbeddingsInOptionSet OpenAIEmbeddingsInOptionSetOptions = OpenAIEmbeddingsInOptionSet.Create(); - private static Option RequestInput { get; } = new(@"--request-input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-embeddings2", @"Openai Embeddings"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(UserAgent); - command.Options.Add(XiApiKey); - command.Options.Add(ServiceTier); - command.Options.Add(InputOption); command.Options.Add(OpenAIEmbeddingsInOptionSetOptions.Model); - command.Options.Add(OpenAIEmbeddingsInOptionSetOptions.EncodingFormat); - command.Options.Add(OpenAIEmbeddingsInOptionSetOptions.Dimensions); - command.Options.Add(RequestInput); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(RequestInput) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --request-input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - RequestInput, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var userAgent = parseResult.GetValue(UserAgent); - var xiApiKey = parseResult.GetValue(XiApiKey); - var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); - var input = parseResult.GetRequiredValue(InputOption); var model = parseResult.GetRequiredValue(OpenAIEmbeddingsInOptionSetOptions.Model); - var encodingFormat = CliRuntime.WasSpecified(parseResult, OpenAIEmbeddingsInOptionSetOptions.EncodingFormat) ? parseResult.GetValue(OpenAIEmbeddingsInOptionSetOptions.EncodingFormat) : (__requestBase is { } __EncodingFormatBaseValue ? __EncodingFormatBaseValue.EncodingFormat : default); - var dimensions = CliRuntime.WasSpecified(parseResult, OpenAIEmbeddingsInOptionSetOptions.Dimensions) ? parseResult.GetValue(OpenAIEmbeddingsInOptionSetOptions.Dimensions) : (__requestBase is { } __DimensionsBaseValue ? __DimensionsBaseValue.Dimensions : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiEmbeddings2Async( - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - serviceTier: serviceTier, - input: input, - model: model, - encodingFormat: encodingFormat, - dimensions: dimensions, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiEmbeddingsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiEmbeddingsCommandApiCommand.g.cs deleted file mode 100644 index bf456257..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiEmbeddingsCommandApiCommand.g.cs +++ /dev/null @@ -1,144 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiEmbeddingsCommandApiCommand -{ - private static Option XDeepinfraSource { get; } = new( - name: @"--x-deepinfra-source") - { - Description = @"", - }; - - private static Option UserAgent { get; } = new( - name: @"--user-agent") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ServiceTier { get; } = new( - name: @"--service-tier") - { - 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).", - }; - - private static Option, string>> InputOption { get; } = new( - name: @"--input") - { - Description = @"sequences to embed", - Required = true, - }; - private static readonly OpenAIEmbeddingsInOptionSet OpenAIEmbeddingsInOptionSetOptions = OpenAIEmbeddingsInOptionSet.Create(); - private static Option RequestInput { get; } = new(@"--request-input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-embeddings", @"Openai Embeddings"); - command.Options.Add(XDeepinfraSource); - command.Options.Add(UserAgent); - command.Options.Add(XiApiKey); - command.Options.Add(ServiceTier); - command.Options.Add(InputOption); command.Options.Add(OpenAIEmbeddingsInOptionSetOptions.Model); - command.Options.Add(OpenAIEmbeddingsInOptionSetOptions.EncodingFormat); - command.Options.Add(OpenAIEmbeddingsInOptionSetOptions.Dimensions); - command.Options.Add(RequestInput); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(RequestInput) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --request-input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - RequestInput, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); - var userAgent = parseResult.GetValue(UserAgent); - var xiApiKey = parseResult.GetValue(XiApiKey); - var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); - var input = parseResult.GetRequiredValue(InputOption); var model = parseResult.GetRequiredValue(OpenAIEmbeddingsInOptionSetOptions.Model); - var encodingFormat = CliRuntime.WasSpecified(parseResult, OpenAIEmbeddingsInOptionSetOptions.EncodingFormat) ? parseResult.GetValue(OpenAIEmbeddingsInOptionSetOptions.EncodingFormat) : (__requestBase is { } __EncodingFormatBaseValue ? __EncodingFormatBaseValue.EncodingFormat : default); - var dimensions = CliRuntime.WasSpecified(parseResult, OpenAIEmbeddingsInOptionSetOptions.Dimensions) ? parseResult.GetValue(OpenAIEmbeddingsInOptionSetOptions.Dimensions) : (__requestBase is { } __DimensionsBaseValue ? __DimensionsBaseValue.Dimensions : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiEmbeddingsAsync( - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - serviceTier: serviceTier, - input: input, - model: model, - encodingFormat: encodingFormat, - dimensions: dimensions, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiFiles2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiFiles2CommandApiCommand.g.cs deleted file mode 100644 index d3616fd9..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiFiles2CommandApiCommand.g.cs +++ /dev/null @@ -1,83 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiFiles2CommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Purpose { get; } = new( - name: @"--purpose") - { - Description = @"", - Required = true, - }; - - private static Option> File { get; } = new( - name: @"--file") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-files2", @"Openai Files"); - command.Options.Add(XiApiKey); - command.Options.Add(Purpose); - command.Options.Add(File); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - var purpose = parseResult.GetRequiredValue(Purpose); - var file = parseResult.GetRequiredValue(File); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiFiles2Async( - xiApiKey: xiApiKey, - purpose: purpose, - file: file, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiFilesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiFilesCommandApiCommand.g.cs deleted file mode 100644 index 4a5cbf73..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiFilesCommandApiCommand.g.cs +++ /dev/null @@ -1,83 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiFilesCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Purpose { get; } = new( - name: @"--purpose") - { - Description = @"", - Required = true, - }; - - private static Option> File { get; } = new( - name: @"--file") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-files", @"Openai Files"); - command.Options.Add(XiApiKey); - command.Options.Add(Purpose); - command.Options.Add(File); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - var purpose = parseResult.GetRequiredValue(Purpose); - var file = parseResult.GetRequiredValue(File); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiFilesAsync( - xiApiKey: xiApiKey, - purpose: purpose, - file: file, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesEdits2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiImagesEdits2CommandApiCommand.g.cs deleted file mode 100644 index ab218d7c..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesEdits2CommandApiCommand.g.cs +++ /dev/null @@ -1,179 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiImagesEdits2CommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Image { get; } = new( - name: @"--image") - { - Description = @"", - Required = true, - }; - - private static Option Imagename { get; } = new( - name: @"--imagename") - { - Description = @"", - Required = true, - }; - - private static Option Prompt { get; } = new( - name: @"--prompt") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - private static readonly OpenAIImagesEditsInOptionSet InpOptions = OpenAIImagesEditsInOptionSet.Create(@"inp"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-images-edits2", @"Openai Images Edits -Edit image using OpenAI Images Edits API"); - command.Options.Add(XiApiKey); - command.Options.Add(Image); - command.Options.Add(Imagename); - command.Options.Add(Prompt); - command.Options.Add(Model); command.Options.Add(InpOptions.Model); - command.Options.Add(InpOptions.N); - command.Options.Add(InpOptions.Size); - command.Options.Add(InpOptions.User); - command.Options.Add(InpOptions.Imagename); - command.Options.Add(InpOptions.Prompt); - command.Options.Add(InpOptions.Maskname); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var image = parseResult.GetRequiredValue(Image); - var imagename = parseResult.GetRequiredValue(Imagename); - var prompt = parseResult.GetRequiredValue(Prompt); - var model = parseResult.GetRequiredValue(Model); - - var __InpBase = __requestBase is { } __InpBaseValue ? __InpBaseValue.Inp : default; var inpModel = parseResult.GetValue(InpOptions.Model); - var inpN = CliRuntime.WasSpecified(parseResult, InpOptions.N) ? parseResult.GetValue(InpOptions.N) : (__InpBase is { } __InpnBaseValue ? __InpnBaseValue.N : default); - var inpSize = CliRuntime.WasSpecified(parseResult, InpOptions.Size) ? parseResult.GetValue(InpOptions.Size) : (__InpBase is { } __InpsizeBaseValue ? __InpsizeBaseValue.Size : default); - var inpUser = CliRuntime.WasSpecified(parseResult, InpOptions.User) ? parseResult.GetValue(InpOptions.User) : (__InpBase is { } __InpuserBaseValue ? __InpuserBaseValue.User : default); - var inpImagename = parseResult.GetValue(InpOptions.Imagename); - var inpPrompt = parseResult.GetValue(InpOptions.Prompt); - var inpMaskname = CliRuntime.WasSpecified(parseResult, InpOptions.Maskname) ? parseResult.GetValue(InpOptions.Maskname) : (__InpBase is { } __InpmasknameBaseValue ? __InpmasknameBaseValue.Maskname : default); - var __InpSpecified = CliRuntime.WasSpecified(parseResult, InpOptions.Model) || CliRuntime.WasSpecified(parseResult, InpOptions.N) || CliRuntime.WasSpecified(parseResult, InpOptions.Size) || CliRuntime.WasSpecified(parseResult, InpOptions.User) || CliRuntime.WasSpecified(parseResult, InpOptions.Imagename) || CliRuntime.WasSpecified(parseResult, InpOptions.Prompt) || CliRuntime.WasSpecified(parseResult, InpOptions.Maskname); - var inp = - __InpSpecified || __InpBase is not null - ? new global::DeepInfra.OpenAIImagesEditsIn - { - Model = inpModel!, - N = inpN, - Size = inpSize, - User = inpUser, - Imagename = inpImagename!, - Prompt = inpPrompt!, - Maskname = inpMaskname, - Image = __InpBase is not null ? __InpBase.Image : throw new CliException(@"Inp.image is required when using inp options. Provide it with --request-json or --request-file."), - } - : __InpBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiImagesEdits2Async( - xiApiKey: xiApiKey, - image: image, - imagename: imagename, - prompt: prompt, - model: model, - inp: inp, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesEditsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiImagesEditsCommandApiCommand.g.cs deleted file mode 100644 index 39d6be04..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesEditsCommandApiCommand.g.cs +++ /dev/null @@ -1,179 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiImagesEditsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Image { get; } = new( - name: @"--image") - { - Description = @"", - Required = true, - }; - - private static Option Imagename { get; } = new( - name: @"--imagename") - { - Description = @"", - Required = true, - }; - - private static Option Prompt { get; } = new( - name: @"--prompt") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - private static readonly OpenAIImagesEditsInOptionSet InpOptions = OpenAIImagesEditsInOptionSet.Create(@"inp"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-images-edits", @"Openai Images Edits -Edit image using OpenAI Images Edits API"); - command.Options.Add(XiApiKey); - command.Options.Add(Image); - command.Options.Add(Imagename); - command.Options.Add(Prompt); - command.Options.Add(Model); command.Options.Add(InpOptions.Model); - command.Options.Add(InpOptions.N); - command.Options.Add(InpOptions.Size); - command.Options.Add(InpOptions.User); - command.Options.Add(InpOptions.Imagename); - command.Options.Add(InpOptions.Prompt); - command.Options.Add(InpOptions.Maskname); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var image = parseResult.GetRequiredValue(Image); - var imagename = parseResult.GetRequiredValue(Imagename); - var prompt = parseResult.GetRequiredValue(Prompt); - var model = parseResult.GetRequiredValue(Model); - - var __InpBase = __requestBase is { } __InpBaseValue ? __InpBaseValue.Inp : default; var inpModel = parseResult.GetValue(InpOptions.Model); - var inpN = CliRuntime.WasSpecified(parseResult, InpOptions.N) ? parseResult.GetValue(InpOptions.N) : (__InpBase is { } __InpnBaseValue ? __InpnBaseValue.N : default); - var inpSize = CliRuntime.WasSpecified(parseResult, InpOptions.Size) ? parseResult.GetValue(InpOptions.Size) : (__InpBase is { } __InpsizeBaseValue ? __InpsizeBaseValue.Size : default); - var inpUser = CliRuntime.WasSpecified(parseResult, InpOptions.User) ? parseResult.GetValue(InpOptions.User) : (__InpBase is { } __InpuserBaseValue ? __InpuserBaseValue.User : default); - var inpImagename = parseResult.GetValue(InpOptions.Imagename); - var inpPrompt = parseResult.GetValue(InpOptions.Prompt); - var inpMaskname = CliRuntime.WasSpecified(parseResult, InpOptions.Maskname) ? parseResult.GetValue(InpOptions.Maskname) : (__InpBase is { } __InpmasknameBaseValue ? __InpmasknameBaseValue.Maskname : default); - var __InpSpecified = CliRuntime.WasSpecified(parseResult, InpOptions.Model) || CliRuntime.WasSpecified(parseResult, InpOptions.N) || CliRuntime.WasSpecified(parseResult, InpOptions.Size) || CliRuntime.WasSpecified(parseResult, InpOptions.User) || CliRuntime.WasSpecified(parseResult, InpOptions.Imagename) || CliRuntime.WasSpecified(parseResult, InpOptions.Prompt) || CliRuntime.WasSpecified(parseResult, InpOptions.Maskname); - var inp = - __InpSpecified || __InpBase is not null - ? new global::DeepInfra.OpenAIImagesEditsIn - { - Model = inpModel!, - N = inpN, - Size = inpSize, - User = inpUser, - Imagename = inpImagename!, - Prompt = inpPrompt!, - Maskname = inpMaskname, - Image = __InpBase is not null ? __InpBase.Image : throw new CliException(@"Inp.image is required when using inp options. Provide it with --request-json or --request-file."), - } - : __InpBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiImagesEditsAsync( - xiApiKey: xiApiKey, - image: image, - imagename: imagename, - prompt: prompt, - model: model, - inp: inp, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesGenerations2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiImagesGenerations2CommandApiCommand.g.cs deleted file mode 100644 index 59d6e705..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesGenerations2CommandApiCommand.g.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiImagesGenerations2CommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format in which the generated images are returned. Currently only b64_json is supported.", - }; - private static readonly OpenAIImagesGenerationsInOptionSet OpenAIImagesGenerationsInOptionSetOptions = OpenAIImagesGenerationsInOptionSet.Create(); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-images-generations2", @"Openai Images Generations -Generate image using OpenAI Images API"); - command.Options.Add(XiApiKey); - command.Options.Add(ResponseFormat); command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Model); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.N); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Size); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.User); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Prompt); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Quality); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Style); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); var model = parseResult.GetRequiredValue(OpenAIImagesGenerationsInOptionSetOptions.Model); - var n = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.N) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var size = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.Size) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); - var user = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.User) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - var prompt = parseResult.GetRequiredValue(OpenAIImagesGenerationsInOptionSetOptions.Prompt); - var quality = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.Quality) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.Quality) : (__requestBase is { } __QualityBaseValue ? __QualityBaseValue.Quality : default); - var style = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.Style) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiImagesGenerations2Async( - xiApiKey: xiApiKey, - responseFormat: responseFormat, - model: model, - n: n, - size: size, - user: user, - prompt: prompt, - quality: quality, - style: style, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesGenerationsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiImagesGenerationsCommandApiCommand.g.cs deleted file mode 100644 index 923633de..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesGenerationsCommandApiCommand.g.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiImagesGenerationsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option ResponseFormat { get; } = new( - name: @"--response-format") - { - Description = @"The format in which the generated images are returned. Currently only b64_json is supported.", - }; - private static readonly OpenAIImagesGenerationsInOptionSet OpenAIImagesGenerationsInOptionSetOptions = OpenAIImagesGenerationsInOptionSet.Create(); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-images-generations", @"Openai Images Generations -Generate image using OpenAI Images API"); - command.Options.Add(XiApiKey); - command.Options.Add(ResponseFormat); command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Model); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.N); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Size); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.User); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Prompt); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Quality); - command.Options.Add(OpenAIImagesGenerationsInOptionSetOptions.Style); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); var model = parseResult.GetRequiredValue(OpenAIImagesGenerationsInOptionSetOptions.Model); - var n = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.N) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); - var size = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.Size) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); - var user = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.User) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); - var prompt = parseResult.GetRequiredValue(OpenAIImagesGenerationsInOptionSetOptions.Prompt); - var quality = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.Quality) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.Quality) : (__requestBase is { } __QualityBaseValue ? __QualityBaseValue.Quality : default); - var style = CliRuntime.WasSpecified(parseResult, OpenAIImagesGenerationsInOptionSetOptions.Style) ? parseResult.GetValue(OpenAIImagesGenerationsInOptionSetOptions.Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiImagesGenerationsAsync( - xiApiKey: xiApiKey, - responseFormat: responseFormat, - model: model, - n: n, - size: size, - user: user, - prompt: prompt, - quality: quality, - style: style, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesVariations2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiImagesVariations2CommandApiCommand.g.cs deleted file mode 100644 index 083292f7..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesVariations2CommandApiCommand.g.cs +++ /dev/null @@ -1,163 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiImagesVariations2CommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Image { get; } = new( - name: @"--image") - { - Description = @"", - Required = true, - }; - - private static Option Imagename { get; } = new( - name: @"--imagename") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - private static readonly OpenAIImagesVariationsInOptionSet InpOptions = OpenAIImagesVariationsInOptionSet.Create(@"inp"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-images-variations2", @"Openai Images Variations -Generate a similar image using OpenAI Images Variations API"); - command.Options.Add(XiApiKey); - command.Options.Add(Image); - command.Options.Add(Imagename); - command.Options.Add(Model); command.Options.Add(InpOptions.Model); - command.Options.Add(InpOptions.N); - command.Options.Add(InpOptions.Size); - command.Options.Add(InpOptions.User); - command.Options.Add(InpOptions.Imagename); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var image = parseResult.GetRequiredValue(Image); - var imagename = parseResult.GetRequiredValue(Imagename); - var model = parseResult.GetRequiredValue(Model); - - var __InpBase = __requestBase is { } __InpBaseValue ? __InpBaseValue.Inp : default; var inpModel = parseResult.GetValue(InpOptions.Model); - var inpN = CliRuntime.WasSpecified(parseResult, InpOptions.N) ? parseResult.GetValue(InpOptions.N) : (__InpBase is { } __InpnBaseValue ? __InpnBaseValue.N : default); - var inpSize = CliRuntime.WasSpecified(parseResult, InpOptions.Size) ? parseResult.GetValue(InpOptions.Size) : (__InpBase is { } __InpsizeBaseValue ? __InpsizeBaseValue.Size : default); - var inpUser = CliRuntime.WasSpecified(parseResult, InpOptions.User) ? parseResult.GetValue(InpOptions.User) : (__InpBase is { } __InpuserBaseValue ? __InpuserBaseValue.User : default); - var inpImagename = parseResult.GetValue(InpOptions.Imagename); - var __InpSpecified = CliRuntime.WasSpecified(parseResult, InpOptions.Model) || CliRuntime.WasSpecified(parseResult, InpOptions.N) || CliRuntime.WasSpecified(parseResult, InpOptions.Size) || CliRuntime.WasSpecified(parseResult, InpOptions.User) || CliRuntime.WasSpecified(parseResult, InpOptions.Imagename); - var inp = - __InpSpecified || __InpBase is not null - ? new global::DeepInfra.OpenAIImagesVariationsIn - { - Model = inpModel!, - N = inpN, - Size = inpSize, - User = inpUser, - Imagename = inpImagename!, - Image = __InpBase is not null ? __InpBase.Image : throw new CliException(@"Inp.image is required when using inp options. Provide it with --request-json or --request-file."), - } - : __InpBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiImagesVariations2Async( - xiApiKey: xiApiKey, - image: image, - imagename: imagename, - model: model, - inp: inp, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesVariationsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiImagesVariationsCommandApiCommand.g.cs deleted file mode 100644 index 5e8ba342..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiImagesVariationsCommandApiCommand.g.cs +++ /dev/null @@ -1,163 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiImagesVariationsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Image { get; } = new( - name: @"--image") - { - Description = @"", - Required = true, - }; - - private static Option Imagename { get; } = new( - name: @"--imagename") - { - Description = @"", - Required = true, - }; - - private static Option Model { get; } = new( - name: @"--model") - { - Description = @"", - Required = true, - }; - private static readonly OpenAIImagesVariationsInOptionSet InpOptions = OpenAIImagesVariationsInOptionSet.Create(@"inp"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIImagesOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-images-variations", @"Openai Images Variations -Generate a similar image using OpenAI Images Variations API"); - command.Options.Add(XiApiKey); - command.Options.Add(Image); - command.Options.Add(Imagename); - command.Options.Add(Model); command.Options.Add(InpOptions.Model); - command.Options.Add(InpOptions.N); - command.Options.Add(InpOptions.Size); - command.Options.Add(InpOptions.User); - command.Options.Add(InpOptions.Imagename); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var image = parseResult.GetRequiredValue(Image); - var imagename = parseResult.GetRequiredValue(Imagename); - var model = parseResult.GetRequiredValue(Model); - - var __InpBase = __requestBase is { } __InpBaseValue ? __InpBaseValue.Inp : default; var inpModel = parseResult.GetValue(InpOptions.Model); - var inpN = CliRuntime.WasSpecified(parseResult, InpOptions.N) ? parseResult.GetValue(InpOptions.N) : (__InpBase is { } __InpnBaseValue ? __InpnBaseValue.N : default); - var inpSize = CliRuntime.WasSpecified(parseResult, InpOptions.Size) ? parseResult.GetValue(InpOptions.Size) : (__InpBase is { } __InpsizeBaseValue ? __InpsizeBaseValue.Size : default); - var inpUser = CliRuntime.WasSpecified(parseResult, InpOptions.User) ? parseResult.GetValue(InpOptions.User) : (__InpBase is { } __InpuserBaseValue ? __InpuserBaseValue.User : default); - var inpImagename = parseResult.GetValue(InpOptions.Imagename); - var __InpSpecified = CliRuntime.WasSpecified(parseResult, InpOptions.Model) || CliRuntime.WasSpecified(parseResult, InpOptions.N) || CliRuntime.WasSpecified(parseResult, InpOptions.Size) || CliRuntime.WasSpecified(parseResult, InpOptions.User) || CliRuntime.WasSpecified(parseResult, InpOptions.Imagename); - var inp = - __InpSpecified || __InpBase is not null - ? new global::DeepInfra.OpenAIImagesVariationsIn - { - Model = inpModel!, - N = inpN, - Size = inpSize, - User = inpUser, - Imagename = inpImagename!, - Image = __InpBase is not null ? __InpBase.Image : throw new CliException(@"Inp.image is required when using inp options. Provide it with --request-json or --request-file."), - } - : __InpBase; - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiImagesVariationsAsync( - xiApiKey: xiApiKey, - image: image, - imagename: imagename, - model: model, - inp: inp, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiModels2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiModels2CommandApiCommand.g.cs deleted file mode 100644 index 3a712012..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiModels2CommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiModels2CommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIModelsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIModelsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-models2", @"Openai Models"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiModels2Async( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenaiModelsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenaiModelsCommandApiCommand.g.cs deleted file mode 100644 index 6c09a64a..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenaiModelsCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenaiModelsCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenAIModelsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenAIModelsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openai-models", @"Openai Models"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenaiModelsAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/OpenrouterModelsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/OpenrouterModelsCommandApiCommand.g.cs deleted file mode 100644 index 04b490c8..00000000 --- a/src/cli/DeepInfra.CLI/Commands/OpenrouterModelsCommandApiCommand.g.cs +++ /dev/null @@ -1,67 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class OpenrouterModelsCommandApiCommand -{ - - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.OpenRouterModelsOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.OpenRouterModelsOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"openrouter-models", @"Openrouter Models"); - - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.OpenrouterModelsAsync( - - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Data", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/PrivateModelsListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/PrivateModelsListCommandApiCommand.g.cs deleted file mode 100644 index fd40e661..00000000 --- a/src/cli/DeepInfra.CLI/Commands/PrivateModelsListCommandApiCommand.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class PrivateModelsListCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"private-models-list", @"Private Models List"); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.PrivateModelsListAsync( - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"$self", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RentGpuAvailabilityCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RentGpuAvailabilityCommandApiCommand.g.cs deleted file mode 100644 index 46d6d994..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RentGpuAvailabilityCommandApiCommand.g.cs +++ /dev/null @@ -1,89 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RentGpuAvailabilityCommandApiCommand -{ - private static Option Source { get; } = new( - name: @"--source") - { - Description = @"", - }; - - private static Option BaseModel { get; } = new( - name: @"--base-model") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeployGPUAvailability value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"rent-gpu-availability", @"Rent Gpu Availability"); - command.Options.Add(Source); - command.Options.Add(BaseModel); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var source = parseResult.GetValue(Source); - var baseModel = parseResult.GetValue(BaseModel); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RentGpuAvailabilityAsync( - source: source, - baseModel: baseModel, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Gpus", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RequestGpuLimitIncreaseCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RequestGpuLimitIncreaseCommandApiCommand.g.cs deleted file mode 100644 index 08923f6d..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RequestGpuLimitIncreaseCommandApiCommand.g.cs +++ /dev/null @@ -1,93 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RequestGpuLimitIncreaseCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option GpuType { get; } = new( - name: @"--gpu-type") - { - Description = @"", - Required = true, - }; - - private static Option RequestedLimit { get; } = new( - name: @"--requested-limit") - { - Description = @"", - Required = true, - }; - - private static Option Reason { get; } = new( - name: @"--reason") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"request-gpu-limit-increase", @"Request Gpu Limit Increase"); - command.Options.Add(XiApiKey); - command.Options.Add(GpuType); - command.Options.Add(RequestedLimit); - command.Options.Add(Reason); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - var gpuType = parseResult.GetRequiredValue(GpuType); - var requestedLimit = parseResult.GetRequiredValue(RequestedLimit); - var reason = parseResult.GetRequiredValue(Reason); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RequestGpuLimitIncreaseAsync( - xiApiKey: xiApiKey, - gpuType: gpuType, - requestedLimit: requestedLimit, - reason: reason, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RequestRateLimitIncreaseCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RequestRateLimitIncreaseCommandApiCommand.g.cs deleted file mode 100644 index ca9a8afa..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RequestRateLimitIncreaseCommandApiCommand.g.cs +++ /dev/null @@ -1,128 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RequestRateLimitIncreaseCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option RateLimit { get; } = new( - name: @"--rate-limit") - { - Description = @"", - Required = true, - }; - - private static Option TpmRateLimit { get; } = new( - name: @"--tpm-rate-limit") - { - Description = @"", - }; - - private static Option Reason { get; } = new( - name: @"--reason") - { - Description = @"", - Required = true, - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"request-rate-limit-increase", @"Request Rate Limit Increase"); - command.Options.Add(XiApiKey); - command.Options.Add(RateLimit); - command.Options.Add(TpmRateLimit); - command.Options.Add(Reason); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var rateLimit = parseResult.GetRequiredValue(RateLimit); - var tpmRateLimit = CliRuntime.WasSpecified(parseResult, TpmRateLimit) ? parseResult.GetValue(TpmRateLimit) : (__requestBase is { } __TpmRateLimitBaseValue ? __TpmRateLimitBaseValue.TpmRateLimit : default); - var reason = parseResult.GetRequiredValue(Reason); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RequestRateLimitIncreaseAsync( - xiApiKey: xiApiKey, - rateLimit: rateLimit, - tpmRateLimit: tpmRateLimit, - reason: reason, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatch2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatch2CommandApiCommand.g.cs deleted file mode 100644 index 05d85f6e..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatch2CommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RetrieveOpenaiBatch2CommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"retrieve-openai-batch2", @"Retrieve Openai Batch"); - command.Arguments.Add(BatchId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RetrieveOpenaiBatch2Async( - batchId: batchId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatchCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatchCommandApiCommand.g.cs deleted file mode 100644 index 71c29f2e..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatchCommandApiCommand.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RetrieveOpenaiBatchCommandApiCommand -{ - private static Argument BatchId { get; } = new( - name: @"batch-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"retrieve-openai-batch", @"Retrieve Openai Batch"); - command.Arguments.Add(BatchId); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var batchId = parseResult.GetRequiredValue(BatchId); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RetrieveOpenaiBatchAsync( - batchId: batchId, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatches2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatches2CommandApiCommand.g.cs deleted file mode 100644 index 32f72bf1..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatches2CommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RetrieveOpenaiBatches2CommandApiCommand -{ - private static Option After { get; } = new( - name: @"--after") - { - Description = @"", - Required = true, - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"retrieve-openai-batches2", @"Retrieve Openai Batches"); - command.Options.Add(After); - command.Options.Add(Limit); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var after = parseResult.GetRequiredValue(After); - var limit = parseResult.GetValue(Limit); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RetrieveOpenaiBatches2Async( - after: after, - limit: limit, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatchesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatchesCommandApiCommand.g.cs deleted file mode 100644 index 488511ca..00000000 --- a/src/cli/DeepInfra.CLI/Commands/RetrieveOpenaiBatchesCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class RetrieveOpenaiBatchesCommandApiCommand -{ - private static Option After { get; } = new( - name: @"--after") - { - Description = @"", - Required = true, - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"retrieve-openai-batches", @"Retrieve Openai Batches"); - command.Options.Add(After); - command.Options.Add(Limit); - command.Options.Add(XiApiKey); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var after = parseResult.GetRequiredValue(After); - var limit = parseResult.GetValue(Limit); - var xiApiKey = parseResult.GetValue(XiApiKey); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.RetrieveOpenaiBatchesAsync( - after: after, - limit: limit, - xiApiKey: xiApiKey, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesApiGroupCommand.g.cs new file mode 100644 index 00000000..606d61b0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesApiGroupCommand.g.cs @@ -0,0 +1,24 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class SandboxesApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"sandboxes", @"Sandboxes endpoint commands."); + command.Subcommands.Add(SandboxesCreateSandboxCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesDeleteSandboxCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesExecCommandCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesGetSandboxCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesListSandboxPlansCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesListSandboxesCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesReadFileCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesStartSandboxCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesStopSandboxCommandApiCommand.Create()); + command.Subcommands.Add(SandboxesWriteFileCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesCreateSandboxCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesCreateSandboxCommandApiCommand.g.cs new file mode 100644 index 00000000..5f298adb --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesCreateSandboxCommandApiCommand.g.cs @@ -0,0 +1,136 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesCreateSandboxCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Plan { get; } = new( + name: @"--plan") + { + Description = @"", + }; + + private static Option?> Tags { get; } = new( + name: @"--tags") + { + Description = @"", + }; + + private static Option TimeoutSeconds { get; } = new( + name: @"--timeout-seconds") + { + Description = @"", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.SandboxCreateOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.SandboxCreateOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-sandbox", @"Create Sandbox +Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously."); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Plan); + command.Options.Add(Tags); + command.Options.Add(TimeoutSeconds); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var plan = CliRuntime.WasSpecified(parseResult, Plan) ? parseResult.GetValue(Plan) : (__requestBase is { } __PlanBaseValue ? __PlanBaseValue.Plan : default); + var tags = CliRuntime.WasSpecified(parseResult, Tags) ? parseResult.GetValue(Tags) : (__requestBase is { } __TagsBaseValue ? __TagsBaseValue.Tags : default); + var timeoutSeconds = CliRuntime.WasSpecified(parseResult, TimeoutSeconds) ? parseResult.GetValue(TimeoutSeconds) : (__requestBase is { } __TimeoutSecondsBaseValue ? __TimeoutSecondsBaseValue.TimeoutSeconds : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.CreateSandboxAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + plan: plan, + tags: tags, + timeoutSeconds: timeoutSeconds, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesDeleteSandboxCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesDeleteSandboxCommandApiCommand.g.cs new file mode 100644 index 00000000..c64b0af5 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesDeleteSandboxCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesDeleteSandboxCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-sandbox", @"Delete Sandbox"); + command.Arguments.Add(SandboxId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.DeleteSandboxAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesExecCommandCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesExecCommandCommandApiCommand.g.cs new file mode 100644 index 00000000..a065ef7b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesExecCommandCommandApiCommand.g.cs @@ -0,0 +1,137 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesExecCommandCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option> CommandOption { get; } = new( + name: @"--command") + { + Description = @"", + Required = true, + }; + + private static Option TimeoutSeconds { get; } = new( + name: @"--timeout-seconds") + { + Description = @"Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"exec-command", @"Exec Command +Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {""stdout"": ...}/{""stderr"": ...} chunks followed by exactly one terminal {""returncode"": N} or {""error"": msg} line."); + command.Arguments.Add(SandboxId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(CommandOption); + command.Options.Add(TimeoutSeconds); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var command = parseResult.GetRequiredValue(CommandOption); + var timeoutSeconds = CliRuntime.WasSpecified(parseResult, TimeoutSeconds) ? parseResult.GetValue(TimeoutSeconds) : (__requestBase is { } __TimeoutSecondsBaseValue ? __TimeoutSecondsBaseValue.TimeoutSeconds : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.ExecCommandAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + command: command, + timeoutSeconds: timeoutSeconds, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesGetSandboxCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesGetSandboxCommandApiCommand.g.cs new file mode 100644 index 00000000..8001bbb2 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesGetSandboxCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesGetSandboxCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.SandboxOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.SandboxOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-sandbox", @"Get Sandbox"); + command.Arguments.Add(SandboxId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.GetSandboxAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesListSandboxPlansCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesListSandboxPlansCommandApiCommand.g.cs new file mode 100644 index 00000000..8dcfbec2 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesListSandboxPlansCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesListSandboxPlansCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list-sandbox-plans", @"List Sandbox Plans +Returns all available sandbox plans with their resource specs and pricing."); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.ListSandboxPlansAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesListSandboxesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesListSandboxesCommandApiCommand.g.cs new file mode 100644 index 00000000..92e60a25 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesListSandboxesCommandApiCommand.g.cs @@ -0,0 +1,80 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesListSandboxesCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::System.Collections.Generic.IList value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::System.Collections.Generic.IList value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"list-sandboxes", @"List Sandboxes"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.ListSandboxesAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"$self", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesReadFileCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesReadFileCommandApiCommand.g.cs new file mode 100644 index 00000000..f1dce0d9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesReadFileCommandApiCommand.g.cs @@ -0,0 +1,92 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesReadFileCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option Path { get; } = new( + name: @"--path") + { + Description = @"", + Required = true, + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"read-file", @"Read File +Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-stream)."); + command.Arguments.Add(SandboxId); + command.Options.Add(Path); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var path = parseResult.GetRequiredValue(Path); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.ReadFileAsync( + sandboxId: sandboxId, + path: path, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesStartSandboxCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesStartSandboxCommandApiCommand.g.cs new file mode 100644 index 00000000..6d2443c3 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesStartSandboxCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesStartSandboxCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"start-sandbox", @"Start Sandbox"); + command.Arguments.Add(SandboxId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.StartSandboxAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesStopSandboxCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesStopSandboxCommandApiCommand.g.cs new file mode 100644 index 00000000..89a5452e --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesStopSandboxCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesStopSandboxCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"stop-sandbox", @"Stop Sandbox"); + command.Arguments.Add(SandboxId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.StopSandboxAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SandboxesWriteFileCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SandboxesWriteFileCommandApiCommand.g.cs new file mode 100644 index 00000000..ff00851c --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/SandboxesWriteFileCommandApiCommand.g.cs @@ -0,0 +1,92 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class SandboxesWriteFileCommandApiCommand +{ + private static Argument SandboxId { get; } = new( + name: @"sandbox-id") + { + Description = @"", + }; + + private static Option Path { get; } = new( + name: @"--path") + { + Description = @"", + Required = true, + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"write-file", @"Write File +Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox."); + command.Arguments.Add(SandboxId); + command.Options.Add(Path); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var sandboxId = parseResult.GetRequiredValue(SandboxId); + var path = parseResult.GetRequiredValue(Path); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Sandboxes.WriteFileAsync( + sandboxId: sandboxId, + path: path, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SetConfigCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SetConfigCommandApiCommand.g.cs deleted file mode 100644 index 01776c07..00000000 --- a/src/cli/DeepInfra.CLI/Commands/SetConfigCommandApiCommand.g.cs +++ /dev/null @@ -1,108 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class SetConfigCommandApiCommand -{ - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static Option Limit { get; } = new( - name: @"--limit") - { - Description = @"Set usage limit (in USD). Negative means no limit.null/not-set means don't change it", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.ConfigOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.ConfigOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"set-config", @"Set Config"); - command.Options.Add(Session); - command.Options.Add(Limit); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var session = parseResult.GetValue(Session); - var limit = CliRuntime.WasSpecified(parseResult, Limit) ? parseResult.GetValue(Limit) : (__requestBase is { } __LimitBaseValue ? __LimitBaseValue.Limit : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.SetConfigAsync( - session: session, - limit: limit, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SetupTopupCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SetupTopupCommandApiCommand.g.cs deleted file mode 100644 index 2d516659..00000000 --- a/src/cli/DeepInfra.CLI/Commands/SetupTopupCommandApiCommand.g.cs +++ /dev/null @@ -1,124 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class SetupTopupCommandApiCommand -{ - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static Option Amount { get; } = new( - name: @"--amount") - { - Description = @"Amount to top up in cents", - }; - - private static Option Threshold { get; } = new( - name: @"--threshold") - { - Description = @"Top up threshold in cents, if balance goes below this value, top up will be triggered", - }; - - private static Option Enabled { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--enabled", - description: @"If true, top up will be triggered when balance goes below threshold"); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"setup-topup", @"Setup Topup"); - command.Options.Add(Session); - command.Options.Add(Amount); - command.Options.Add(Threshold); - command.Options.Add(Enabled); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var session = parseResult.GetValue(Session); - var amount = CliRuntime.WasSpecified(parseResult, Amount) ? parseResult.GetValue(Amount) : (__requestBase is { } __AmountBaseValue ? __AmountBaseValue.Amount : default); - var threshold = CliRuntime.WasSpecified(parseResult, Threshold) ? parseResult.GetValue(Threshold) : (__requestBase is { } __ThresholdBaseValue ? __ThresholdBaseValue.Threshold : default); - var enabled = CliRuntime.WasSpecified(parseResult, Enabled) ? parseResult.GetValue(Enabled) : (__requestBase is { } __EnabledBaseValue ? __EnabledBaseValue.Enabled : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.SetupTopupAsync( - session: session, - amount: amount, - threshold: threshold, - enabled: enabled, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/StandardArgsOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/StandardArgsOptionSet.g.cs new file mode 100644 index 00000000..d163bbe0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/StandardArgsOptionSet.g.cs @@ -0,0 +1,39 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal sealed record StandardArgsOptionSet( + Option MaxContextSize, + Option MaxConcurrentRequests, + Option GpuMemoryFraction, + Option MaxPrefillTokens, + Option EnablePrefixCaching) +{ + public static StandardArgsOptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new StandardArgsOptionSet( + MaxContextSize: new Option($"--{normalizedPrefix}max-context-size") + { + Description = @"Maximum total sequence length (prompt + generation).", + }, + MaxConcurrentRequests: new Option($"--{normalizedPrefix}max-concurrent-requests") + { + Description = @"Max number of requests served concurrently.", + }, + GpuMemoryFraction: new Option($"--{normalizedPrefix}gpu-memory-fraction") + { + Description = @"Fraction of GPU memory the engine may use for weights + KV cache.", + }, + MaxPrefillTokens: new Option($"--{normalizedPrefix}max-prefill-tokens") + { + Description = @"Max tokens processed per prefill/engine step (chunked prefill size).", + }, + EnablePrefixCaching: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enable-prefix-caching", description: @"Reuse KV cache for shared prompt prefixes.") + ); + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/SubmitFeedbackCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/SubmitFeedbackCommandApiCommand.g.cs deleted file mode 100644 index 81d3373d..00000000 --- a/src/cli/DeepInfra.CLI/Commands/SubmitFeedbackCommandApiCommand.g.cs +++ /dev/null @@ -1,119 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class SubmitFeedbackCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Message { get; } = new( - name: @"--message") - { - Description = @"The message you'd like to send to deepinfra team", - Required = true, - }; - - private static Option ContactEmail { get; } = new( - name: @"--contact-email") - { - Description = @"Optional contact email to reach you back", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"submit-feedback", @"Submit Feedback -Submit feedback"); - command.Options.Add(XiApiKey); - command.Options.Add(Message); - command.Options.Add(ContactEmail); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var message = parseResult.GetRequiredValue(Message); - var contactEmail = CliRuntime.WasSpecified(parseResult, ContactEmail) ? parseResult.GetValue(ContactEmail) : (__requestBase is { } __ContactEmailBaseValue ? __ContactEmailBaseValue.ContactEmail : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.SubmitFeedbackAsync( - xiApiKey: xiApiKey, - message: message, - contactEmail: contactEmail, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TeamSetDisplayNameCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TeamSetDisplayNameCommandApiCommand.g.cs deleted file mode 100644 index 37d36bb3..00000000 --- a/src/cli/DeepInfra.CLI/Commands/TeamSetDisplayNameCommandApiCommand.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class TeamSetDisplayNameCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option DisplayName { get; } = new( - name: @"--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.", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"team-set-display-name", @"Team Set Display Name"); - command.Options.Add(XiApiKey); - command.Options.Add(DisplayName); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var xiApiKey = parseResult.GetValue(XiApiKey); - var displayName = parseResult.GetRequiredValue(DisplayName); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.TeamSetDisplayNameAsync( - xiApiKey: xiApiKey, - displayName: displayName, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextCompletionsApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextCompletionsApiGroupCommand.g.cs new file mode 100644 index 00000000..d8f923db --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextCompletionsApiGroupCommand.g.cs @@ -0,0 +1,15 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class TextCompletionsApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"text-completions", @"Text Completions endpoint commands."); + command.Subcommands.Add(TextCompletionsOpenaiCompletionsCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextCompletionsOpenaiCompletionsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextCompletionsOpenaiCompletionsCommandApiCommand.g.cs new file mode 100644 index 00000000..8896d923 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextCompletionsOpenaiCompletionsCommandApiCommand.g.cs @@ -0,0 +1,370 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextCompletionsOpenaiCompletionsCommandApiCommand +{ + private static Option XDeepinfraSource { get; } = new( + name: @"--x-deepinfra-source") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option ServiceTier { get; } = new( + name: @"--service-tier") + { + Description = @"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.", + }; + + private static Option FailFast { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--fail-fast", + description: @"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior."); + + private static Option?> Models { get; } = new( + name: @"--models") + { + Description = @"Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence.", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"model name", + Required = true, + }; + + private static Option>> Prompt { get; } = new( + name: @"--prompt") + { + Description = @"input prompt - a single string is currently supported", + Required = true, + }; + + private static Option MaxTokens { get; } = new( + name: @"--max-tokens") + { + Description = @"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 65536, whichever is smaller.", + }; + + private static Option Temperature { get; } = new( + name: @"--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", + }; + + private static Option TopP { get; } = new( + name: @"--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.", + }; + + private static Option MinP { get; } = new( + name: @"--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.", + }; + + private static Option TopK { get; } = new( + name: @"--top-k") + { + Description = @"Sample from the best k (number of) tokens. 0 means off", + }; + + private static Option N { get; } = new( + name: @"--n") + { + Description = @"number of sequences to return", + }; + + private static Option Stream { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--stream", + description: @"whether to stream the output via SSE or return the full response"); + + private static Option Logprobs { get; } = new( + name: @"--logprobs") + { + Description = @"return top tokens and their log-probabilities", + }; + + private static Option Echo { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--echo", + description: @"return prompt as part of the respons"); + + private static Option, object>?> Stop { get; } = new( + name: @"--stop") + { + Description = @"up to 16 sequences where the API will stop generating further tokens", + }; + + private static Option PresencePenalty { get; } = new( + name: @"--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.", + }; + + private static Option FrequencyPenalty { get; } = new( + name: @"--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.", + }; + + private static Option?> ResponseFormat { get; } = new( + name: @"--response-format") + { + Description = @"The format of the response. Currently, only json is supported.", + }; + + private static Option RepetitionPenalty { get; } = new( + name: @"--repetition-penalty") + { + Description = @"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)", + }; + + private static Option User { get; } = new( + name: @"--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.", + }; + + private static Option Seed { get; } = new( + name: @"--seed") + { + Description = @"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed.", + }; + + private static Option?> StopTokenIds { get; } = new( + name: @"--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.", + }; + + private static Option ReturnTokensAsTokenIds { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--return-tokens-as-token-ids", + description: @"return tokens as token ids"); + + private static Option PromptCacheKey { get; } = new( + name: @"--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.", + }; + + private static Option PromptCacheOptions { get; } = new( + name: @"--prompt-cache-options") + { + Description = @"Prompt cache options for this request's prefix, e.g. {""ttl"": ""1h""}.", + }; + + private static Option Data { get; } = new( + name: @"--data") + { + 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,...').", + }; + + private static Option IgnoreEos { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--ignore-eos", + description: @"Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed."); + private static readonly StreamOptionsOptionSet StreamOptionsOptions = StreamOptionsOptionSet.Create(@"stream"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openai-completions", @"Openai Completions"); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(ServiceTier); + command.Options.Add(FailFast); + command.Options.Add(Models); + command.Options.Add(Model); + command.Options.Add(Prompt); + command.Options.Add(MaxTokens); + command.Options.Add(Temperature); + command.Options.Add(TopP); + command.Options.Add(MinP); + command.Options.Add(TopK); + command.Options.Add(N); + command.Options.Add(Stream); + command.Options.Add(Logprobs); + command.Options.Add(Echo); + command.Options.Add(Stop); + command.Options.Add(PresencePenalty); + command.Options.Add(FrequencyPenalty); + command.Options.Add(ResponseFormat); + command.Options.Add(RepetitionPenalty); + command.Options.Add(User); + command.Options.Add(Seed); + command.Options.Add(StopTokenIds); + command.Options.Add(ReturnTokensAsTokenIds); + command.Options.Add(PromptCacheKey); + command.Options.Add(PromptCacheOptions); + command.Options.Add(Data); + command.Options.Add(IgnoreEos); command.Options.Add(StreamOptionsOptions.IncludeUsage); + command.Options.Add(StreamOptionsOptions.ContinuousUsageStats); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var serviceTier = CliRuntime.WasSpecified(parseResult, ServiceTier) ? parseResult.GetValue(ServiceTier) : (__requestBase is { } __ServiceTierBaseValue ? __ServiceTierBaseValue.ServiceTier : default); + var failFast = CliRuntime.WasSpecified(parseResult, FailFast) ? parseResult.GetValue(FailFast) : (__requestBase is { } __FailFastBaseValue ? __FailFastBaseValue.FailFast : default); + var models = CliRuntime.WasSpecified(parseResult, Models) ? parseResult.GetValue(Models) : (__requestBase is { } __ModelsBaseValue ? __ModelsBaseValue.Models : default); + var model = parseResult.GetRequiredValue(Model); + var prompt = parseResult.GetRequiredValue(Prompt); + var maxTokens = CliRuntime.WasSpecified(parseResult, MaxTokens) ? parseResult.GetValue(MaxTokens) : (__requestBase is { } __MaxTokensBaseValue ? __MaxTokensBaseValue.MaxTokens : default); + var temperature = CliRuntime.WasSpecified(parseResult, Temperature) ? parseResult.GetValue(Temperature) : (__requestBase is { } __TemperatureBaseValue ? __TemperatureBaseValue.Temperature : default); + var topP = CliRuntime.WasSpecified(parseResult, TopP) ? parseResult.GetValue(TopP) : (__requestBase is { } __TopPBaseValue ? __TopPBaseValue.TopP : default); + var minP = CliRuntime.WasSpecified(parseResult, MinP) ? parseResult.GetValue(MinP) : (__requestBase is { } __MinPBaseValue ? __MinPBaseValue.MinP : default); + var topK = CliRuntime.WasSpecified(parseResult, TopK) ? parseResult.GetValue(TopK) : (__requestBase is { } __TopKBaseValue ? __TopKBaseValue.TopK : default); + var n = CliRuntime.WasSpecified(parseResult, N) ? parseResult.GetValue(N) : (__requestBase is { } __NBaseValue ? __NBaseValue.N : default); + var stream = CliRuntime.WasSpecified(parseResult, Stream) ? parseResult.GetValue(Stream) : (__requestBase is { } __StreamBaseValue ? __StreamBaseValue.Stream : default); + var logprobs = CliRuntime.WasSpecified(parseResult, Logprobs) ? parseResult.GetValue(Logprobs) : (__requestBase is { } __LogprobsBaseValue ? __LogprobsBaseValue.Logprobs : default); + var echo = CliRuntime.WasSpecified(parseResult, Echo) ? parseResult.GetValue(Echo) : (__requestBase is { } __EchoBaseValue ? __EchoBaseValue.Echo : default); + var stop = CliRuntime.WasSpecified(parseResult, Stop) ? parseResult.GetValue(Stop) : (__requestBase is { } __StopBaseValue ? __StopBaseValue.Stop : default); + var presencePenalty = CliRuntime.WasSpecified(parseResult, PresencePenalty) ? parseResult.GetValue(PresencePenalty) : (__requestBase is { } __PresencePenaltyBaseValue ? __PresencePenaltyBaseValue.PresencePenalty : default); + var frequencyPenalty = CliRuntime.WasSpecified(parseResult, FrequencyPenalty) ? parseResult.GetValue(FrequencyPenalty) : (__requestBase is { } __FrequencyPenaltyBaseValue ? __FrequencyPenaltyBaseValue.FrequencyPenalty : default); + var responseFormat = CliRuntime.WasSpecified(parseResult, ResponseFormat) ? parseResult.GetValue(ResponseFormat) : (__requestBase is { } __ResponseFormatBaseValue ? __ResponseFormatBaseValue.ResponseFormat : default); + var repetitionPenalty = CliRuntime.WasSpecified(parseResult, RepetitionPenalty) ? parseResult.GetValue(RepetitionPenalty) : (__requestBase is { } __RepetitionPenaltyBaseValue ? __RepetitionPenaltyBaseValue.RepetitionPenalty : default); + var user = CliRuntime.WasSpecified(parseResult, User) ? parseResult.GetValue(User) : (__requestBase is { } __UserBaseValue ? __UserBaseValue.User : default); + var seed = CliRuntime.WasSpecified(parseResult, Seed) ? parseResult.GetValue(Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); + var stopTokenIds = CliRuntime.WasSpecified(parseResult, StopTokenIds) ? parseResult.GetValue(StopTokenIds) : (__requestBase is { } __StopTokenIdsBaseValue ? __StopTokenIdsBaseValue.StopTokenIds : default); + var returnTokensAsTokenIds = CliRuntime.WasSpecified(parseResult, ReturnTokensAsTokenIds) ? parseResult.GetValue(ReturnTokensAsTokenIds) : (__requestBase is { } __ReturnTokensAsTokenIdsBaseValue ? __ReturnTokensAsTokenIdsBaseValue.ReturnTokensAsTokenIds : default); + var promptCacheKey = CliRuntime.WasSpecified(parseResult, PromptCacheKey) ? parseResult.GetValue(PromptCacheKey) : (__requestBase is { } __PromptCacheKeyBaseValue ? __PromptCacheKeyBaseValue.PromptCacheKey : default); + var promptCacheOptions = CliRuntime.WasSpecified(parseResult, PromptCacheOptions) ? parseResult.GetValue(PromptCacheOptions) : (__requestBase is { } __PromptCacheOptionsBaseValue ? __PromptCacheOptionsBaseValue.PromptCacheOptions : default); + var data = CliRuntime.WasSpecified(parseResult, Data) ? parseResult.GetValue(Data) : (__requestBase is { } __DataBaseValue ? __DataBaseValue.Data : default); + var ignoreEos = CliRuntime.WasSpecified(parseResult, IgnoreEos) ? parseResult.GetValue(IgnoreEos) : (__requestBase is { } __IgnoreEosBaseValue ? __IgnoreEosBaseValue.IgnoreEos : default); + + var __StreamOptionsBase = __requestBase is { } __StreamOptionsBaseValue ? __StreamOptionsBaseValue.StreamOptions : default; var streamOptionsIncludeUsage = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) ? parseResult.GetValue(StreamOptionsOptions.IncludeUsage) : (__StreamOptionsBase is { } __StreamOptionsincludeUsageBaseValue ? __StreamOptionsincludeUsageBaseValue.IncludeUsage : default); + var streamOptionsContinuousUsageStats = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats) ? parseResult.GetValue(StreamOptionsOptions.ContinuousUsageStats) : (__StreamOptionsBase is { } __StreamOptionscontinuousUsageStatsBaseValue ? __StreamOptionscontinuousUsageStatsBaseValue.ContinuousUsageStats : default); + var __StreamOptionsSpecified = CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.IncludeUsage) || CliRuntime.WasSpecified(parseResult, StreamOptionsOptions.ContinuousUsageStats); + var streamOptions = + __StreamOptionsSpecified || __StreamOptionsBase is not null + ? new global::DeepInfra.StreamOptions + { + IncludeUsage = streamOptionsIncludeUsage, + ContinuousUsageStats = streamOptionsContinuousUsageStats, + + } + : __StreamOptionsBase; + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextCompletions.OpenaiCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + serviceTier: serviceTier, + failFast: failFast, + models: models, + 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, + stopTokenIds: stopTokenIds, + returnTokensAsTokenIds: returnTokensAsTokenIds, + promptCacheKey: promptCacheKey, + promptCacheOptions: promptCacheOptions, + data: data, + ignoreEos: ignoreEos, + streamOptions: streamOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechApiGroupCommand.g.cs new file mode 100644 index 00000000..35a1f1be --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechApiGroupCommand.g.cs @@ -0,0 +1,21 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class TextToSpeechApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"text-to-speech", @"Text to Speech endpoint commands."); + command.Subcommands.Add(TextToSpeechCreateVoiceCommandApiCommand.Create()); + command.Subcommands.Add(TextToSpeechDeleteVoiceCommandApiCommand.Create()); + command.Subcommands.Add(TextToSpeechGetVoiceCommandApiCommand.Create()); + command.Subcommands.Add(TextToSpeechGetVoicesCommandApiCommand.Create()); + command.Subcommands.Add(TextToSpeechTextToSpeechCommandApiCommand.Create()); + command.Subcommands.Add(TextToSpeechTextToSpeechStreamCommandApiCommand.Create()); + command.Subcommands.Add(TextToSpeechUpdateVoiceCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechCommandApiCommand.g.cs deleted file mode 100644 index ea99610b..00000000 --- a/src/cli/DeepInfra.CLI/Commands/TextToSpeechCommandApiCommand.g.cs +++ /dev/null @@ -1,128 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class TextToSpeechCommandApiCommand -{ - private static Argument VoiceId { get; } = new( - name: @"voice-id") - { - Description = @"", - }; - - private static Option OutputFormat { get; } = new( - name: @"--output-format") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - private static readonly ElevenLabsTextToSpeechInOptionSet ElevenLabsTextToSpeechInOptionSetOptions = ElevenLabsTextToSpeechInOptionSet.Create(); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"text-to-speech", @"Text To Speech"); - command.Arguments.Add(VoiceId); - command.Options.Add(OutputFormat); - command.Options.Add(XiApiKey); command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.Text); - command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.ModelId); - command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat); - command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var voiceId = parseResult.GetRequiredValue(VoiceId); - var outputFormat = parseResult.GetValue(OutputFormat); - var xiApiKey = parseResult.GetValue(XiApiKey); var text = parseResult.GetRequiredValue(ElevenLabsTextToSpeechInOptionSetOptions.Text); - var modelId = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.ModelId) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.ModelId) : (__requestBase is { } __ModelIdBaseValue ? __ModelIdBaseValue.ModelId : default); - var requestOutputFormat = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) : (__requestBase is { } __RequestOutputFormatBaseValue ? __RequestOutputFormatBaseValue.OutputFormat : default); - var languageCode = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) : (__requestBase is { } __LanguageCodeBaseValue ? __LanguageCodeBaseValue.LanguageCode : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.TextToSpeechAsync( - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - text: text, - modelId: modelId, - requestOutputFormat: requestOutputFormat, - languageCode: languageCode, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechCreateVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechCreateVoiceCommandApiCommand.g.cs new file mode 100644 index 00000000..b8427bf7 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechCreateVoiceCommandApiCommand.g.cs @@ -0,0 +1,102 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechCreateVoiceCommandApiCommand +{ + private static Argument NameOption { get; } = new( + name: @"name") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option DescriptionOption { get; } = new( + name: @"--description") + { + Description = @"", + Required = true, + }; + + private static Option> Files { get; } = new( + name: @"--files") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Voice value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Voice value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-voice", @"Create Voice +Create a new voice"); + command.Arguments.Add(NameOption); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(DescriptionOption); + command.Options.Add(Files); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var name = parseResult.GetRequiredValue(NameOption); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var description = parseResult.GetRequiredValue(DescriptionOption); + var files = parseResult.GetRequiredValue(Files); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.CreateVoiceAsync( + name: name, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + description: description, + files: files, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechDeleteVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechDeleteVoiceCommandApiCommand.g.cs new file mode 100644 index 00000000..46a36d8b --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechDeleteVoiceCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechDeleteVoiceCommandApiCommand +{ + private static Argument VoiceId { get; } = new( + name: @"voice-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"delete-voice", @"Delete Voice"); + command.Arguments.Add(VoiceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var voiceId = parseResult.GetRequiredValue(VoiceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.DeleteVoiceAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechGetVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechGetVoiceCommandApiCommand.g.cs new file mode 100644 index 00000000..a0237ac4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechGetVoiceCommandApiCommand.g.cs @@ -0,0 +1,82 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechGetVoiceCommandApiCommand +{ + private static Argument VoiceId { get; } = new( + name: @"voice-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Voice value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Voice value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-voice", @"Get Voice +Get a voice by its id"); + command.Arguments.Add(VoiceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var voiceId = parseResult.GetRequiredValue(VoiceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.GetVoiceAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechGetVoicesCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechGetVoicesCommandApiCommand.g.cs new file mode 100644 index 00000000..89dac074 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechGetVoicesCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechGetVoicesCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.GetVoicesOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.GetVoicesOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-voices", @"Get Voices +Get available voices for a given user"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.GetVoicesAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Voices", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechStreamCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechStreamCommandApiCommand.g.cs deleted file mode 100644 index 23c4fefd..00000000 --- a/src/cli/DeepInfra.CLI/Commands/TextToSpeechStreamCommandApiCommand.g.cs +++ /dev/null @@ -1,128 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class TextToSpeechStreamCommandApiCommand -{ - private static Argument VoiceId { get; } = new( - name: @"voice-id") - { - Description = @"", - }; - - private static Option OutputFormat { get; } = new( - name: @"--output-format") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - private static readonly ElevenLabsTextToSpeechInOptionSet ElevenLabsTextToSpeechInOptionSetOptions = ElevenLabsTextToSpeechInOptionSet.Create(); - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"text-to-speech-stream", @"Text To Speech Stream"); - command.Arguments.Add(VoiceId); - command.Options.Add(OutputFormat); - command.Options.Add(XiApiKey); command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.Text); - command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.ModelId); - command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat); - command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var voiceId = parseResult.GetRequiredValue(VoiceId); - var outputFormat = parseResult.GetValue(OutputFormat); - var xiApiKey = parseResult.GetValue(XiApiKey); var text = parseResult.GetRequiredValue(ElevenLabsTextToSpeechInOptionSetOptions.Text); - var modelId = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.ModelId) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.ModelId) : (__requestBase is { } __ModelIdBaseValue ? __ModelIdBaseValue.ModelId : default); - var requestOutputFormat = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) : (__requestBase is { } __RequestOutputFormatBaseValue ? __RequestOutputFormatBaseValue.OutputFormat : default); - var languageCode = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) : (__requestBase is { } __LanguageCodeBaseValue ? __LanguageCodeBaseValue.LanguageCode : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.TextToSpeechStreamAsync( - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - text: text, - modelId: modelId, - requestOutputFormat: requestOutputFormat, - languageCode: languageCode, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechTextToSpeechCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechTextToSpeechCommandApiCommand.g.cs new file mode 100644 index 00000000..fc04e427 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechTextToSpeechCommandApiCommand.g.cs @@ -0,0 +1,137 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechTextToSpeechCommandApiCommand +{ + private static Argument VoiceId { get; } = new( + name: @"voice-id") + { + Description = @"", + }; + + private static Option OutputFormat { get; } = new( + name: @"--output-format") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + private static readonly ElevenLabsTextToSpeechInOptionSet ElevenLabsTextToSpeechInOptionSetOptions = ElevenLabsTextToSpeechInOptionSet.Create(); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"text-to-speech", @"Text To Speech"); + command.Arguments.Add(VoiceId); + command.Options.Add(OutputFormat); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.Text); + command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.ModelId); + command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat); + command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var voiceId = parseResult.GetRequiredValue(VoiceId); + var outputFormat = parseResult.GetValue(OutputFormat); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); var text = parseResult.GetRequiredValue(ElevenLabsTextToSpeechInOptionSetOptions.Text); + var modelId = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.ModelId) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.ModelId) : (__requestBase is { } __ModelIdBaseValue ? __ModelIdBaseValue.ModelId : default); + var requestOutputFormat = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) : (__requestBase is { } __RequestOutputFormatBaseValue ? __RequestOutputFormatBaseValue.OutputFormat : default); + var languageCode = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) : (__requestBase is { } __LanguageCodeBaseValue ? __LanguageCodeBaseValue.LanguageCode : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.TextToSpeechAsync( + voiceId: voiceId, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + text: text, + modelId: modelId, + requestOutputFormat: requestOutputFormat, + languageCode: languageCode, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechTextToSpeechStreamCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechTextToSpeechStreamCommandApiCommand.g.cs new file mode 100644 index 00000000..0c73f7cb --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechTextToSpeechStreamCommandApiCommand.g.cs @@ -0,0 +1,137 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechTextToSpeechStreamCommandApiCommand +{ + private static Argument VoiceId { get; } = new( + name: @"voice-id") + { + Description = @"", + }; + + private static Option OutputFormat { get; } = new( + name: @"--output-format") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + private static readonly ElevenLabsTextToSpeechInOptionSet ElevenLabsTextToSpeechInOptionSetOptions = ElevenLabsTextToSpeechInOptionSet.Create(); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"stream", @"Text To Speech Stream"); + command.Arguments.Add(VoiceId); + command.Options.Add(OutputFormat); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.Text); + command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.ModelId); + command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat); + command.Options.Add(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var voiceId = parseResult.GetRequiredValue(VoiceId); + var outputFormat = parseResult.GetValue(OutputFormat); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); var text = parseResult.GetRequiredValue(ElevenLabsTextToSpeechInOptionSetOptions.Text); + var modelId = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.ModelId) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.ModelId) : (__requestBase is { } __ModelIdBaseValue ? __ModelIdBaseValue.ModelId : default); + var requestOutputFormat = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.OutputFormat) : (__requestBase is { } __RequestOutputFormatBaseValue ? __RequestOutputFormatBaseValue.OutputFormat : default); + var languageCode = CliRuntime.WasSpecified(parseResult, ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) ? parseResult.GetValue(ElevenLabsTextToSpeechInOptionSetOptions.LanguageCode) : (__requestBase is { } __LanguageCodeBaseValue ? __LanguageCodeBaseValue.LanguageCode : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.TextToSpeechStreamAsync( + voiceId: voiceId, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + text: text, + modelId: modelId, + requestOutputFormat: requestOutputFormat, + languageCode: languageCode, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TextToSpeechUpdateVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TextToSpeechUpdateVoiceCommandApiCommand.g.cs new file mode 100644 index 00000000..c989fe2f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextToSpeechUpdateVoiceCommandApiCommand.g.cs @@ -0,0 +1,101 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TextToSpeechUpdateVoiceCommandApiCommand +{ + private static Argument VoiceId { get; } = new( + name: @"voice-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option NameOption { get; } = new( + name: @"--name") + { + Description = @"", + Required = true, + }; + + private static Option DescriptionOption { get; } = new( + name: @"--description") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Voice value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Voice value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"update-voice", @"Update Voice"); + command.Arguments.Add(VoiceId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(NameOption); + command.Options.Add(DescriptionOption); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var voiceId = parseResult.GetRequiredValue(VoiceId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var name = parseResult.GetRequiredValue(NameOption); + var description = parseResult.GetRequiredValue(DescriptionOption); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.TextToSpeech.UpdateVoiceAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + name: name, + description: description, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TokenizerApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TokenizerApiGroupCommand.g.cs new file mode 100644 index 00000000..7754d686 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TokenizerApiGroupCommand.g.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class TokenizerApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"tokenizer", @"Tokenizer endpoint commands."); + command.Subcommands.Add(TokenizerDetokenizeCommandApiCommand.Create()); + command.Subcommands.Add(TokenizerTokenizeCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TokenizerDetokenizeCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TokenizerDetokenizeCommandApiCommand.g.cs new file mode 100644 index 00000000..f90afbe3 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TokenizerDetokenizeCommandApiCommand.g.cs @@ -0,0 +1,127 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TokenizerDetokenizeCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"model name", + Required = true, + }; + + private static Option?> Tokens { get; } = new( + name: @"--tokens") + { + Description = @"token ids to detokenize", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DetokenizeOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DetokenizeOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"detokenize", @"Detokenize"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Model); + command.Options.Add(Tokens); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var model = parseResult.GetRequiredValue(Model); + var tokens = CliRuntime.WasSpecified(parseResult, Tokens) ? parseResult.GetValue(Tokens) : (__requestBase is { } __TokensBaseValue ? __TokensBaseValue.Tokens : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Tokenizer.DetokenizeAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + model: model, + tokens: tokens, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/TokenizerTokenizeCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/TokenizerTokenizeCommandApiCommand.g.cs new file mode 100644 index 00000000..e867a8c0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TokenizerTokenizeCommandApiCommand.g.cs @@ -0,0 +1,151 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class TokenizerTokenizeCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Model { get; } = new( + name: @"--model") + { + Description = @"model name", + Required = true, + }; + + private static Option Prompt { get; } = new( + name: @"--prompt") + { + Description = @"text to tokenize (completion form)", + }; + + private static Option?> Messages { get; } = new( + name: @"--messages") + { + Description = @"chat messages to tokenize (chat form)", + }; + + private static Option ReturnTokenStrs { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--return-token-strs", + description: @"also return the per-token strings (vLLM)"); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.TokenizeOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.TokenizeOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"tokenize", @"Tokenize"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Model); + command.Options.Add(Prompt); + command.Options.Add(Messages); + command.Options.Add(ReturnTokenStrs); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var model = parseResult.GetRequiredValue(Model); + var prompt = CliRuntime.WasSpecified(parseResult, Prompt) ? parseResult.GetValue(Prompt) : (__requestBase is { } __PromptBaseValue ? __PromptBaseValue.Prompt : default); + var messages = CliRuntime.WasSpecified(parseResult, Messages) ? parseResult.GetValue(Messages) : (__requestBase is { } __MessagesBaseValue ? __MessagesBaseValue.Messages : default); + var returnTokenStrs = CliRuntime.WasSpecified(parseResult, ReturnTokenStrs) ? parseResult.GetValue(ReturnTokenStrs) : (__requestBase is { } __ReturnTokenStrsBaseValue ? __ReturnTokenStrsBaseValue.ReturnTokenStrs : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Tokenizer.TokenizeAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + model: model, + prompt: prompt, + messages: messages, + returnTokenStrs: returnTokenStrs, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + @"Tokens", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UpdateLoraCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UpdateLoraCommandApiCommand.g.cs deleted file mode 100644 index 0326cb39..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UpdateLoraCommandApiCommand.g.cs +++ /dev/null @@ -1,124 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UpdateLoraCommandApiCommand -{ - private static Argument LoraName { get; } = new( - name: @"lora-name") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option Private { get; } = CliRuntime.CreateNullableBoolOption( - name: @"--private", - description: @""); - - private static Option DescriptionOption { get; } = new( - name: @"--description") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"update-lora", @"Update Lora"); - command.Arguments.Add(LoraName); - command.Options.Add(XiApiKey); - command.Options.Add(Private); - command.Options.Add(DescriptionOption); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var loraName = parseResult.GetRequiredValue(LoraName); - var xiApiKey = parseResult.GetValue(XiApiKey); - var @private = CliRuntime.WasSpecified(parseResult, Private) ? parseResult.GetValue(Private) : (__requestBase is { } __PrivateBaseValue ? __PrivateBaseValue.Private : default); - var description = CliRuntime.WasSpecified(parseResult, DescriptionOption) ? parseResult.GetValue(DescriptionOption) : (__requestBase is { } __DescriptionBaseValue ? __DescriptionBaseValue.Description : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UpdateLoraAsync( - loraName: loraName, - xiApiKey: xiApiKey, - @private: @private, - description: description, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UpdateVoiceCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UpdateVoiceCommandApiCommand.g.cs deleted file mode 100644 index 403f19cf..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UpdateVoiceCommandApiCommand.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UpdateVoiceCommandApiCommand -{ - private static Argument VoiceId { get; } = new( - name: @"voice-id") - { - Description = @"", - }; - - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option NameOption { get; } = new( - name: @"--name") - { - Description = @"", - Required = true, - }; - - private static Option DescriptionOption { get; } = new( - name: @"--description") - { - Description = @"", - Required = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.Voice value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.Voice value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"update-voice", @"Update Voice"); - command.Arguments.Add(VoiceId); - command.Options.Add(XiApiKey); - command.Options.Add(NameOption); - command.Options.Add(DescriptionOption); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var voiceId = parseResult.GetRequiredValue(VoiceId); - var xiApiKey = parseResult.GetValue(XiApiKey); - var name = parseResult.GetRequiredValue(NameOption); - var description = parseResult.GetRequiredValue(DescriptionOption); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UpdateVoiceAsync( - voiceId: voiceId, - xiApiKey: xiApiKey, - name: name, - description: description, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UploadLoraModelCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UploadLoraModelCommandApiCommand.g.cs deleted file mode 100644 index f07ad8ea..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UploadLoraModelCommandApiCommand.g.cs +++ /dev/null @@ -1,137 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UploadLoraModelCommandApiCommand -{ - private static Option XiApiKey { get; } = new( - name: @"--xi-api-key") - { - Description = @"", - }; - - private static Option HfModelName { get; } = new( - name: @"--hf-model-name") - { - Description = @"", - Required = true, - }; - - private static Option HfToken { get; } = new( - name: @"--hf-token") - { - Description = @"", - }; - - private static Option LoraModelName { get; } = new( - name: @"--lora-model-name") - { - Description = @"", - Required = true, - }; - - private static Option BaseModelName { get; } = new( - name: @"--base-model-name") - { - Description = @"", - }; - private static Option Input { get; } = new(@"--input") - { - Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", - }; - - private static Option RequestJson { get; } = new(@"--request-json") - { - Description = "Request body as JSON.", - Hidden = true, - }; - - private static Option RequestFile { get; } = new(@"--request-file") - { - Description = "Path to a JSON request file, or '-' for stdin.", - Hidden = true, - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.DeploymentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.DeploymentOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"upload-lora-model", @"Upload Lora Model"); - command.Options.Add(XiApiKey); - command.Options.Add(HfModelName); - command.Options.Add(HfToken); - command.Options.Add(LoraModelName); - command.Options.Add(BaseModelName); - command.Options.Add(Input); - command.Options.Add(RequestJson); - command.Options.Add(RequestFile); - command.Validators.Add(result => - { - var hasInput = result.GetResult(Input) is not null; - var hasRequestJson = result.GetResult(RequestJson) is not null; - var hasRequestFile = result.GetResult(RequestFile) is not null; - var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); - if (specifiedCount > 1) - { - result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); - } - }); - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( - parseResult, - Input, - RequestJson, - RequestFile, - global::DeepInfra.SourceGenerationContext.Default, - cancellationToken).ConfigureAwait(false); - var xiApiKey = parseResult.GetValue(XiApiKey); - var hfModelName = parseResult.GetRequiredValue(HfModelName); - var hfToken = CliRuntime.WasSpecified(parseResult, HfToken) ? parseResult.GetValue(HfToken) : (__requestBase is { } __HfTokenBaseValue ? __HfTokenBaseValue.HfToken : default); - var loraModelName = parseResult.GetRequiredValue(LoraModelName); - var baseModelName = CliRuntime.WasSpecified(parseResult, BaseModelName) ? parseResult.GetValue(BaseModelName) : (__requestBase is { } __BaseModelNameBaseValue ? __BaseModelNameBaseValue.BaseModelName : default); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UploadLoraModelAsync( - xiApiKey: xiApiKey, - hfModelName: hfModelName, - hfToken: hfToken, - loraModelName: loraModelName, - baseModelName: baseModelName, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UsageApiTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UsageApiTokenCommandApiCommand.g.cs deleted file mode 100644 index e60e9f08..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UsageApiTokenCommandApiCommand.g.cs +++ /dev/null @@ -1,99 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UsageApiTokenCommandApiCommand -{ - private static Argument ApiToken { get; } = new( - name: @"api-token") - { - Description = @"", - }; - - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period (if missing a single month marked by from is return), same format as from", - }; - - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"usage-api-token", @"Usage Api Token"); - command.Arguments.Add(ApiToken); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var apiToken = parseResult.GetRequiredValue(ApiToken); - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UsageApiTokenAsync( - apiToken: apiToken, - from: from, - to: to, - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Months", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UsageCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UsageCommandApiCommand.g.cs deleted file mode 100644 index 6f4b36cb..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UsageCommandApiCommand.g.cs +++ /dev/null @@ -1,90 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UsageCommandApiCommand -{ - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period (if missing a single month marked by from is return), same format as from", - }; - - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"usage", @"Usage"); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UsageAsync( - from: from, - to: to, - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Months", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UsageRentCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UsageRentCommandApiCommand.g.cs deleted file mode 100644 index 8f6dd604..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UsageRentCommandApiCommand.g.cs +++ /dev/null @@ -1,82 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UsageRentCommandApiCommand -{ - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period, in seconds since unix epoch", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period, in seconds since unix epoch", - }; - - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageRentOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageRentOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"usage-rent", @"Usage Rent"); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UsageRentAsync( - from: from, - to: to, - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UsageTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UsageTokensCommandApiCommand.g.cs deleted file mode 100644 index 95b0959d..00000000 --- a/src/cli/DeepInfra.CLI/Commands/UsageTokensCommandApiCommand.g.cs +++ /dev/null @@ -1,90 +0,0 @@ -#nullable enable -#pragma warning disable CS0618 - -using System.CommandLine; - -namespace DeepInfra.CLI.Commands; - -internal static partial class UsageTokensCommandApiCommand -{ - private static Option From { get; } = new( - name: @"--from") - { - Description = @"start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format", - Required = true, - }; - - private static Option To { get; } = new( - name: @"--to") - { - Description = @"end of period (if missing a single month marked by from is return), same format as from", - }; - - private static Option Session { get; } = new( - name: @"--session") - { - Description = @"", - }; - - private static string FormatResponse(ParseResult parseResult, global::DeepInfra.UsageOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) - { - string? text = null; - CustomizeResponseText(parseResult, value, ref text); - if (!string.IsNullOrWhiteSpace(text)) - { - return text; - } - - var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) - { - }; - CustomizeResponseFormatHints(hints); - return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); - } - - static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.UsageOut value, ref string? text); - static partial void CustomizeResponseFormatHints(Dictionary hints); - - - public static Command Create() - { - var command = new Command(@"usage-tokens", @"Usage Tokens"); - command.Options.Add(From); - command.Options.Add(To); - command.Options.Add(Session); - - - command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => - await CliRuntime.RunAsync(async () => - { - var from = parseResult.GetRequiredValue(From); - var to = parseResult.GetValue(To); - var session = parseResult.GetValue(Session); - using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); - - - var response = await client.UsageTokensAsync( - from: from, - to: to, - session: session, - cancellationToken: cancellationToken).ConfigureAwait(false); - - - if (!await CliRuntime.TryWriteOutputDirectoryAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - @"Months", - cancellationToken).ConfigureAwait(false)) - { - await CliRuntime.WriteResponseAsync( - parseResult, - response, - global::DeepInfra.SourceGenerationContext.Default, - FormatResponse, - cancellationToken).ConfigureAwait(false); - } - }, cancellationToken).ConfigureAwait(false)); - return command; - } -} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UtilitiesApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UtilitiesApiGroupCommand.g.cs new file mode 100644 index 00000000..def6d8e9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/UtilitiesApiGroupCommand.g.cs @@ -0,0 +1,16 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class UtilitiesApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"utilities", @"Utilities endpoint commands."); + command.Subcommands.Add(UtilitiesCliVersionCommandApiCommand.Create()); + command.Subcommands.Add(UtilitiesSubmitFeedbackCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UtilitiesCliVersionCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UtilitiesCliVersionCommandApiCommand.g.cs new file mode 100644 index 00000000..c69ee8dc --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/UtilitiesCliVersionCommandApiCommand.g.cs @@ -0,0 +1,64 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class UtilitiesCliVersionCommandApiCommand +{ + private static Option Version { get; } = new( + name: @"--version") + { + Description = @"", + Required = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"cli-version", @"Cli Version"); + command.Options.Add(Version); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var version = parseResult.GetRequiredValue(Version); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Utilities.CliVersionAsync( + version: version, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/UtilitiesSubmitFeedbackCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/UtilitiesSubmitFeedbackCommandApiCommand.g.cs new file mode 100644 index 00000000..9baa52e9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/UtilitiesSubmitFeedbackCommandApiCommand.g.cs @@ -0,0 +1,128 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class UtilitiesSubmitFeedbackCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static Option Message { get; } = new( + name: @"--message") + { + Description = @"The message you'd like to send to deepinfra team", + Required = true, + }; + + private static Option ContactEmail { get; } = new( + name: @"--contact-email") + { + Description = @"Optional contact email to reach you back", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"submit-feedback", @"Submit Feedback +Submit feedback"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + command.Options.Add(Message); + command.Options.Add(ContactEmail); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + var message = parseResult.GetRequiredValue(Message); + var contactEmail = CliRuntime.WasSpecified(parseResult, ContactEmail) ? parseResult.GetValue(ContactEmail) : (__requestBase is { } __ContactEmailBaseValue ? __ContactEmailBaseValue.ContactEmail : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Utilities.SubmitFeedbackAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + message: message, + contactEmail: contactEmail, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideoGenerationInOptionSet.g.cs b/src/cli/DeepInfra.CLI/Commands/VideoGenerationInOptionSet.g.cs new file mode 100644 index 00000000..04032487 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideoGenerationInOptionSet.g.cs @@ -0,0 +1,64 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal sealed record VideoGenerationInOptionSet( + Option Model, + Option Prompt, + Option NegativePrompt, + Option AspectRatio, + Option Size, + Option Seconds, + Option Seed, + Option Style, + Option ImageUrl) +{ + public static VideoGenerationInOptionSet Create(string? prefix = null) + { + var normalizedPrefix = string.IsNullOrWhiteSpace(prefix) + ? string.Empty + : prefix.Trim().Trim('-') + "-"; + return new VideoGenerationInOptionSet( + Model: new Option($"--{normalizedPrefix}model") + { + Description = @"", + Required = true, + }, + Prompt: new Option($"--{normalizedPrefix}prompt") + { + Description = @"", + Required = true, + }, + NegativePrompt: new Option($"--{normalizedPrefix}negative-prompt") + { + Description = @"", + }, + AspectRatio: new Option($"--{normalizedPrefix}aspect-ratio") + { + Description = @"", + }, + Size: new Option($"--{normalizedPrefix}size") + { + Description = @"", + }, + Seconds: new Option($"--{normalizedPrefix}seconds") + { + Description = @"", + }, + Seed: new Option($"--{normalizedPrefix}seed") + { + Description = @"", + }, + Style: new Option($"--{normalizedPrefix}style") + { + Description = @"", + }, + ImageUrl: new Option($"--{normalizedPrefix}image-url") + { + Description = @"First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video.", + } + ); + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosApiGroupCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosApiGroupCommand.g.cs new file mode 100644 index 00000000..a04adcb4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosApiGroupCommand.g.cs @@ -0,0 +1,20 @@ +#nullable enable + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static class VideosApiGroupCommand +{ + public static Command Create() + { + var command = new Command(@"videos", @"Videos endpoint commands."); + command.Subcommands.Add(VideosCreateVideoGenerationCommandApiCommand.Create()); + command.Subcommands.Add(VideosCreateVideoGeneration2CommandApiCommand.Create()); + command.Subcommands.Add(VideosGetVideoContentCommandApiCommand.Create()); + command.Subcommands.Add(VideosGetVideoContent2CommandApiCommand.Create()); + command.Subcommands.Add(VideosGetVideoGenerationCommandApiCommand.Create()); + command.Subcommands.Add(VideosGetVideoGeneration2CommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGeneration2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGeneration2CommandApiCommand.g.cs new file mode 100644 index 00000000..df6a663a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGeneration2CommandApiCommand.g.cs @@ -0,0 +1,134 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class VideosCreateVideoGeneration2CommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + private static readonly VideoGenerationInOptionSet VideoGenerationInOptionSetOptions = VideoGenerationInOptionSet.Create(); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-video-generation2", @"Create Video Generation"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); command.Options.Add(VideoGenerationInOptionSetOptions.Model); + command.Options.Add(VideoGenerationInOptionSetOptions.Prompt); + command.Options.Add(VideoGenerationInOptionSetOptions.NegativePrompt); + command.Options.Add(VideoGenerationInOptionSetOptions.AspectRatio); + command.Options.Add(VideoGenerationInOptionSetOptions.Size); + command.Options.Add(VideoGenerationInOptionSetOptions.Seconds); + command.Options.Add(VideoGenerationInOptionSetOptions.Seed); + command.Options.Add(VideoGenerationInOptionSetOptions.Style); + command.Options.Add(VideoGenerationInOptionSetOptions.ImageUrl); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); var model = parseResult.GetRequiredValue(VideoGenerationInOptionSetOptions.Model); + var prompt = parseResult.GetRequiredValue(VideoGenerationInOptionSetOptions.Prompt); + var negativePrompt = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.NegativePrompt) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.NegativePrompt) : (__requestBase is { } __NegativePromptBaseValue ? __NegativePromptBaseValue.NegativePrompt : default); + var aspectRatio = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.AspectRatio) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.AspectRatio) : (__requestBase is { } __AspectRatioBaseValue ? __AspectRatioBaseValue.AspectRatio : default); + var size = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Size) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); + var seconds = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Seconds) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Seconds) : (__requestBase is { } __SecondsBaseValue ? __SecondsBaseValue.Seconds : default); + var seed = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Seed) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); + var style = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Style) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); + var imageUrl = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.ImageUrl) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.ImageUrl) : (__requestBase is { } __ImageUrlBaseValue ? __ImageUrlBaseValue.ImageUrl : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Videos.CreateVideoGeneration2Async( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + model: model, + prompt: prompt, + negativePrompt: negativePrompt, + aspectRatio: aspectRatio, + size: size, + seconds: seconds, + seed: seed, + style: style, + imageUrl: imageUrl, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGenerationCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGenerationCommandApiCommand.g.cs new file mode 100644 index 00000000..5320f891 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGenerationCommandApiCommand.g.cs @@ -0,0 +1,134 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class VideosCreateVideoGenerationCommandApiCommand +{ + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + private static readonly VideoGenerationInOptionSet VideoGenerationInOptionSetOptions = VideoGenerationInOptionSet.Create(); + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"create-video-generation", @"Create Video Generation"); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); command.Options.Add(VideoGenerationInOptionSetOptions.Model); + command.Options.Add(VideoGenerationInOptionSetOptions.Prompt); + command.Options.Add(VideoGenerationInOptionSetOptions.NegativePrompt); + command.Options.Add(VideoGenerationInOptionSetOptions.AspectRatio); + command.Options.Add(VideoGenerationInOptionSetOptions.Size); + command.Options.Add(VideoGenerationInOptionSetOptions.Seconds); + command.Options.Add(VideoGenerationInOptionSetOptions.Seed); + command.Options.Add(VideoGenerationInOptionSetOptions.Style); + command.Options.Add(VideoGenerationInOptionSetOptions.ImageUrl); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::DeepInfra.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); var model = parseResult.GetRequiredValue(VideoGenerationInOptionSetOptions.Model); + var prompt = parseResult.GetRequiredValue(VideoGenerationInOptionSetOptions.Prompt); + var negativePrompt = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.NegativePrompt) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.NegativePrompt) : (__requestBase is { } __NegativePromptBaseValue ? __NegativePromptBaseValue.NegativePrompt : default); + var aspectRatio = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.AspectRatio) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.AspectRatio) : (__requestBase is { } __AspectRatioBaseValue ? __AspectRatioBaseValue.AspectRatio : default); + var size = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Size) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Size) : (__requestBase is { } __SizeBaseValue ? __SizeBaseValue.Size : default); + var seconds = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Seconds) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Seconds) : (__requestBase is { } __SecondsBaseValue ? __SecondsBaseValue.Seconds : default); + var seed = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Seed) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Seed) : (__requestBase is { } __SeedBaseValue ? __SeedBaseValue.Seed : default); + var style = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.Style) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.Style) : (__requestBase is { } __StyleBaseValue ? __StyleBaseValue.Style : default); + var imageUrl = CliRuntime.WasSpecified(parseResult, VideoGenerationInOptionSetOptions.ImageUrl) ? parseResult.GetValue(VideoGenerationInOptionSetOptions.ImageUrl) : (__requestBase is { } __ImageUrlBaseValue ? __ImageUrlBaseValue.ImageUrl : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Videos.CreateVideoGenerationAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + model: model, + prompt: prompt, + negativePrompt: negativePrompt, + aspectRatio: aspectRatio, + size: size, + seconds: seconds, + seed: seed, + style: style, + imageUrl: imageUrl, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosGetVideoContent2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoContent2CommandApiCommand.g.cs new file mode 100644 index 00000000..cd322766 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoContent2CommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class VideosGetVideoContent2CommandApiCommand +{ + private static Argument VideoId { get; } = new( + name: @"video-id") + { + Description = @"", + }; + + private static Option Variant { get; } = new( + name: @"--variant") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-video-content2", @"Get Video Content"); + command.Arguments.Add(VideoId); + command.Options.Add(Variant); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var videoId = parseResult.GetRequiredValue(VideoId); + var variant = parseResult.GetValue(Variant); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Videos.GetVideoContent2Async( + videoId: videoId, + variant: variant, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosGetVideoContentCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoContentCommandApiCommand.g.cs new file mode 100644 index 00000000..45ad53b3 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoContentCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class VideosGetVideoContentCommandApiCommand +{ + private static Argument VideoId { get; } = new( + name: @"video-id") + { + Description = @"", + }; + + private static Option Variant { get; } = new( + name: @"--variant") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, string value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-video-content", @"Get Video Content"); + command.Arguments.Add(VideoId); + command.Options.Add(Variant); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var videoId = parseResult.GetRequiredValue(VideoId); + var variant = parseResult.GetValue(Variant); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Videos.GetVideoContentAsync( + videoId: videoId, + variant: variant, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosGetVideoGeneration2CommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoGeneration2CommandApiCommand.g.cs new file mode 100644 index 00000000..d63c045a --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoGeneration2CommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class VideosGetVideoGeneration2CommandApiCommand +{ + private static Argument VideoId { get; } = new( + name: @"video-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-video-generation2", @"Get Video Generation"); + command.Arguments.Add(VideoId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var videoId = parseResult.GetRequiredValue(VideoId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Videos.GetVideoGeneration2Async( + videoId: videoId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/VideosGetVideoGenerationCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoGenerationCommandApiCommand.g.cs new file mode 100644 index 00000000..31f9ee9f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosGetVideoGenerationCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class VideosGetVideoGenerationCommandApiCommand +{ + private static Argument VideoId { get; } = new( + name: @"video-id") + { + Description = @"", + }; + + private static Option XiApiKey { get; } = new( + name: @"--xi-api-key") + { + Description = @"", + }; + + private static Option XApiKey { get; } = new( + name: @"--x-api-key") + { + Description = @"", + }; + + private static string FormatResponse(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::DeepInfra.VideoGenerationOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"get-video-generation", @"Get Video Generation"); + command.Arguments.Add(VideoId); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var videoId = parseResult.GetRequiredValue(VideoId); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.Videos.GetVideoGenerationAsync( + videoId: videoId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::DeepInfra.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/DeepInfra.CLI.csproj b/src/cli/DeepInfra.CLI/DeepInfra.CLI.csproj index 92fa2df0..e2368595 100644 --- a/src/cli/DeepInfra.CLI/DeepInfra.CLI.csproj +++ b/src/cli/DeepInfra.CLI/DeepInfra.CLI.csproj @@ -22,7 +22,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + \ No newline at end of file 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..6afbfd1b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountEmailValues.g.cs @@ -0,0 +1,517 @@ + +#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, + ref string? xApiKey); + partial void PrepareAccountEmailValuesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountEmailValuesAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountEmailValuesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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.AccountGpuPool.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuPool.g.cs new file mode 100644 index 00000000..caa015b8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuPool.g.cs @@ -0,0 +1,517 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AccountGpuPoolSecurityRequirement0 = + 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_AccountGpuPoolSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AccountGpuPoolSecurityRequirement0, + }; + partial void PrepareAccountGpuPoolArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareAccountGpuPoolRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessAccountGpuPoolResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountGpuPoolResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Account Gpu Pool + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AccountGpuPoolAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountGpuPoolAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Account Gpu Pool + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AccountGpuPoolAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountGpuPoolArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountGpuPoolSecurityRequirements, + operationName: "AccountGpuPoolAsync"); + + 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_pool", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAccountGpuPoolRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "AccountGpuPool", + methodName: "AccountGpuPoolAsync", + pathTemplate: "\"/v1/me/gpu_pool\"", + 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: "AccountGpuPool", + methodName: "AccountGpuPoolAsync", + pathTemplate: "\"/v1/me/gpu_pool\"", + 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: "AccountGpuPool", + methodName: "AccountGpuPoolAsync", + pathTemplate: "\"/v1/me/gpu_pool\"", + 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); + ProcessAccountGpuPoolResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuPool", + methodName: "AccountGpuPoolAsync", + pathTemplate: "\"/v1/me/gpu_pool\"", + 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: "AccountGpuPool", + methodName: "AccountGpuPoolAsync", + pathTemplate: "\"/v1/me/gpu_pool\"", + 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); + ProcessAccountGpuPoolResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.GpuPoolOut.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.GpuPoolOut.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..297f59f9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountRateLimit.g.cs @@ -0,0 +1,517 @@ + +#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, + ref string? xApiKey); + partial void PrepareAccountRateLimitRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountRateLimitAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountRateLimitArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..7d6328d9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountUpdateDetails.g.cs @@ -0,0 +1,661 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.MeIn request); + partial void PrepareAccountUpdateDetailsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountUpdateDetailsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareAccountUpdateDetailsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareAccountUpdateDetailsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..3e3c0e6d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.DeleteAccount.g.cs @@ -0,0 +1,480 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeleteAccountRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteAccountAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteAccountArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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.GpuPoolGpuTypes.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.GpuPoolGpuTypes.g.cs new file mode 100644 index 00000000..5a54a08b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.GpuPoolGpuTypes.g.cs @@ -0,0 +1,480 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GpuPoolGpuTypesSecurityRequirement0 = + 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_GpuPoolGpuTypesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GpuPoolGpuTypesSecurityRequirement0, + }; + partial void PrepareGpuPoolGpuTypesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGpuPoolGpuTypesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessGpuPoolGpuTypesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGpuPoolGpuTypesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Gpu Pool Gpu Types + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GpuPoolGpuTypesAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GpuPoolGpuTypesAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Gpu Pool Gpu Types + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GpuPoolGpuTypesAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGpuPoolGpuTypesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GpuPoolGpuTypesSecurityRequirements, + operationName: "GpuPoolGpuTypesAsync"); + + 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/gpu_pool/gpu_types", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGpuPoolGpuTypesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GpuPoolGpuTypes", + methodName: "GpuPoolGpuTypesAsync", + pathTemplate: "\"/v1/gpu_pool/gpu_types\"", + 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: "GpuPoolGpuTypes", + methodName: "GpuPoolGpuTypesAsync", + pathTemplate: "\"/v1/gpu_pool/gpu_types\"", + 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: "GpuPoolGpuTypes", + methodName: "GpuPoolGpuTypesAsync", + pathTemplate: "\"/v1/gpu_pool/gpu_types\"", + 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); + ProcessGpuPoolGpuTypesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GpuPoolGpuTypes", + methodName: "GpuPoolGpuTypesAsync", + pathTemplate: "\"/v1/gpu_pool/gpu_types\"", + 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: "GpuPoolGpuTypes", + methodName: "GpuPoolGpuTypesAsync", + pathTemplate: "\"/v1/gpu_pool/gpu_types\"", + 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); + ProcessGpuPoolGpuTypesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.GpuTypesOut.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.GpuTypesOut.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..0a64749a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.Me.g.cs @@ -0,0 +1,496 @@ + +#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, + ref string? xApiKey); + partial void PrepareMeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? checklist, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await MeAsResponseAsync( + checklist: checklist, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareMeArguments( + httpClient: HttpClient, + checklist: ref checklist, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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.RequestGpuPoolChange.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuPoolChange.g.cs new file mode 100644 index 00000000..883ff048 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuPoolChange.g.cs @@ -0,0 +1,604 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RequestGpuPoolChangeSecurityRequirement0 = + 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_RequestGpuPoolChangeSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RequestGpuPoolChangeSecurityRequirement0, + }; + partial void PrepareRequestGpuPoolChangeArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.GpuPoolRequestIn request); + partial void PrepareRequestGpuPoolChangeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.GpuPoolRequestIn request); + partial void ProcessRequestGpuPoolChangeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRequestGpuPoolChangeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Request Gpu Pool Change + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RequestGpuPoolChangeAsync( + + global::DeepInfra.GpuPoolRequestIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RequestGpuPoolChangeAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Request Gpu Pool Change + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RequestGpuPoolChangeAsResponseAsync( + + global::DeepInfra.GpuPoolRequestIn request, + string? xiApiKey = default, + 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); + PrepareRequestGpuPoolChangeArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RequestGpuPoolChangeSecurityRequirements, + operationName: "RequestGpuPoolChangeAsync"); + + 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_pool/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()); + } + 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); + PrepareRequestGpuPoolChangeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "RequestGpuPoolChange", + methodName: "RequestGpuPoolChangeAsync", + pathTemplate: "\"/v1/me/gpu_pool/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: "RequestGpuPoolChange", + methodName: "RequestGpuPoolChangeAsync", + pathTemplate: "\"/v1/me/gpu_pool/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: "RequestGpuPoolChange", + methodName: "RequestGpuPoolChangeAsync", + pathTemplate: "\"/v1/me/gpu_pool/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); + ProcessRequestGpuPoolChangeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuPoolChange", + methodName: "RequestGpuPoolChangeAsync", + pathTemplate: "\"/v1/me/gpu_pool/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: "RequestGpuPoolChange", + methodName: "RequestGpuPoolChangeAsync", + pathTemplate: "\"/v1/me/gpu_pool/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); + } + // 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); + ProcessRequestGpuPoolChangeResponseContent( + 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 Pool Change + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RequestGpuPoolChangeAsync( + string reason, + string? xiApiKey = default, + string? xApiKey = default, + global::System.Collections.Generic.Dictionary? requestedMin = default, + global::System.Collections.Generic.Dictionary? requestedMax = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.GpuPoolRequestIn + { + Reason = reason, + RequestedMin = requestedMin, + RequestedMax = requestedMax, + }; + + return await RequestGpuPoolChangeAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..d36ba5e9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestRateLimitIncrease.g.cs @@ -0,0 +1,604 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.RateLimitRequestIn request); + partial void PrepareRequestRateLimitIncreaseRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RequestRateLimitIncreaseAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareRequestRateLimitIncreaseArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareRequestRateLimitIncreaseRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..e096de69 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.TeamSetDisplayName.g.cs @@ -0,0 +1,600 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.DisplayNameIn request); + partial void PrepareTeamSetDisplayNameRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TeamSetDisplayNameAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareTeamSetDisplayNameArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareTeamSetDisplayNameRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..8a9d8315 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.CreateBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.CreateBackup.g.cs new file mode 100644 index 00000000..57bac39b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.CreateBackup.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateBackupSecurityRequirement0 = + 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_CreateBackupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateBackupSecurityRequirement0, + }; + partial void PrepareCreateBackupArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareCreateBackupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessCreateBackupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateBackupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create 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 CreateBackupAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateBackupAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create 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> CreateBackupAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCreateBackupArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateBackupSecurityRequirements, + operationName: "CreateBackupAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateBackupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "CreateBackup", + methodName: "CreateBackupAsync", + 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: "CreateBackup", + methodName: "CreateBackupAsync", + 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: "CreateBackup", + methodName: "CreateBackupAsync", + 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); + ProcessCreateBackupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateBackup", + methodName: "CreateBackupAsync", + 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: "CreateBackup", + methodName: "CreateBackupAsync", + 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); + ProcessCreateBackupResponseContent( + 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.CreateDashboardLaunchToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.CreateDashboardLaunchToken.g.cs new file mode 100644 index 00000000..91dadcfd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.CreateDashboardLaunchToken.g.cs @@ -0,0 +1,618 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateDashboardLaunchTokenSecurityRequirement0 = + 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_CreateDashboardLaunchTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateDashboardLaunchTokenSecurityRequirement0, + }; + partial void PrepareCreateDashboardLaunchTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareCreateDashboardLaunchTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessCreateDashboardLaunchTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateDashboardLaunchTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Dashboard 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 CreateDashboardLaunchTokenAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateDashboardLaunchTokenAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Dashboard 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> CreateDashboardLaunchTokenAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCreateDashboardLaunchTokenArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateDashboardLaunchTokenSecurityRequirements, + operationName: "CreateDashboardLaunchTokenAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateDashboardLaunchTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "CreateDashboardLaunchToken", + methodName: "CreateDashboardLaunchTokenAsync", + 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: "CreateDashboardLaunchToken", + methodName: "CreateDashboardLaunchTokenAsync", + 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: "CreateDashboardLaunchToken", + methodName: "CreateDashboardLaunchTokenAsync", + 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); + ProcessCreateDashboardLaunchTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateDashboardLaunchToken", + methodName: "CreateDashboardLaunchTokenAsync", + 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: "CreateDashboardLaunchToken", + methodName: "CreateDashboardLaunchTokenAsync", + 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); + ProcessCreateDashboardLaunchTokenResponseContent( + 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.CreateInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.CreateInstance.g.cs new file mode 100644 index 00000000..4ba86794 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.CreateInstance.g.cs @@ -0,0 +1,727 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateInstanceSecurityRequirement0 = + 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_CreateInstanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateInstanceSecurityRequirement0, + }; + partial void PrepareCreateInstanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.AgentCreateIn request); + partial void PrepareCreateInstanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.AgentCreateIn request); + partial void ProcessCreateInstanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateInstanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateInstanceAsync( + + global::DeepInfra.AgentCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateInstanceAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateInstanceAsResponseAsync( + + global::DeepInfra.AgentCreateIn request, + string? xiApiKey = default, + 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); + PrepareCreateInstanceArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateInstanceSecurityRequirements, + operationName: "CreateInstanceAsync"); + + 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()); + } + 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); + PrepareCreateInstanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "CreateInstance", + methodName: "CreateInstanceAsync", + 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: "CreateInstance", + methodName: "CreateInstanceAsync", + 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: "CreateInstance", + methodName: "CreateInstanceAsync", + 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); + ProcessCreateInstanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateInstance", + methodName: "CreateInstanceAsync", + 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: "CreateInstance", + methodName: "CreateInstanceAsync", + 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); + ProcessCreateInstanceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.AgentCreateOut.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.AgentCreateOut.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 Instance + /// + /// + /// + /// + /// 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 CreateInstanceAsync( + string name, + string? xiApiKey = default, + string? xApiKey = default, + string? agentTypeId = default, + string? planId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AgentCreateIn + { + Name = name, + AgentTypeId = agentTypeId, + PlanId = planId, + }; + + return await CreateInstanceAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.DeleteInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.DeleteInstance.g.cs new file mode 100644 index 00000000..88760e5e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.DeleteInstance.g.cs @@ -0,0 +1,559 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteInstanceSecurityRequirement0 = + 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_DeleteInstanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteInstanceSecurityRequirement0, + }; + partial void PrepareDeleteInstanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeleteInstanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeleteInstanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteInstanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteInstanceAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteInstanceArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteInstanceSecurityRequirements, + operationName: "DeleteInstanceAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteInstanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeleteInstance", + methodName: "DeleteInstanceAsync", + 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: "DeleteInstance", + methodName: "DeleteInstanceAsync", + 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: "DeleteInstance", + methodName: "DeleteInstanceAsync", + 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); + ProcessDeleteInstanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteInstance", + methodName: "DeleteInstanceAsync", + 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: "DeleteInstance", + methodName: "DeleteInstanceAsync", + 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); + ProcessDeleteInstanceResponseContent( + 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.GetCatalog.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.GetCatalog.g.cs new file mode 100644 index 00000000..18df0002 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.GetCatalog.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetCatalogSecurityRequirement0 = + 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_GetCatalogSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetCatalogSecurityRequirement0, + }; + partial void PrepareGetCatalogArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetCatalogRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetCatalogResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetCatalogResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get 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> GetCatalogAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetCatalogAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get 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>> GetCatalogAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetCatalogArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetCatalogSecurityRequirements, + operationName: "GetCatalogAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetCatalogRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetCatalog", + methodName: "GetCatalogAsync", + 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: "GetCatalog", + methodName: "GetCatalogAsync", + 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: "GetCatalog", + methodName: "GetCatalogAsync", + 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); + ProcessGetCatalogResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetCatalog", + methodName: "GetCatalogAsync", + 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: "GetCatalog", + methodName: "GetCatalogAsync", + 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); + ProcessGetCatalogResponseContent( + 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.GetInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.GetInstance.g.cs new file mode 100644 index 00000000..8571f57f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.GetInstance.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetInstanceSecurityRequirement0 = + 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_GetInstanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetInstanceSecurityRequirement0, + }; + partial void PrepareGetInstanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetInstanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetInstanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetInstanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetInstanceAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetInstanceArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetInstanceSecurityRequirements, + operationName: "GetInstanceAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetInstanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetInstance", + methodName: "GetInstanceAsync", + 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: "GetInstance", + methodName: "GetInstanceAsync", + 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: "GetInstance", + methodName: "GetInstanceAsync", + 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); + ProcessGetInstanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetInstance", + methodName: "GetInstanceAsync", + 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: "GetInstance", + methodName: "GetInstanceAsync", + 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); + ProcessGetInstanceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.AgentInstanceOut.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.AgentInstanceOut.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.ListBackups.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.ListBackups.g.cs new file mode 100644 index 00000000..bd1d7b94 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.ListBackups.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListBackupsSecurityRequirement0 = + 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_ListBackupsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListBackupsSecurityRequirement0, + }; + partial void PrepareListBackupsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareListBackupsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessListBackupsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListBackupsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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> ListBackupsAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListBackupsAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// 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>> ListBackupsAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListBackupsArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListBackupsSecurityRequirements, + operationName: "ListBackupsAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListBackupsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "ListBackups", + methodName: "ListBackupsAsync", + 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: "ListBackups", + methodName: "ListBackupsAsync", + 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: "ListBackups", + methodName: "ListBackupsAsync", + 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); + ProcessListBackupsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListBackups", + methodName: "ListBackupsAsync", + 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: "ListBackups", + methodName: "ListBackupsAsync", + 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); + ProcessListBackupsResponseContent( + 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.ListInstances.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.ListInstances.g.cs new file mode 100644 index 00000000..a5e89f8b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.ListInstances.g.cs @@ -0,0 +1,535 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListInstancesSecurityRequirement0 = + 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_ListInstancesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListInstancesSecurityRequirement0, + }; + partial void PrepareListInstancesArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::DeepInfra.OpenclawListV1AgentsGetState? state, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareListInstancesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::DeepInfra.OpenclawListV1AgentsGetState? state, + string? xiApiKey, + string? xApiKey); + partial void ProcessListInstancesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListInstancesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Instances + /// + /// + /// 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> ListInstancesAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListInstancesAsResponseAsync( + state: state, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Instances + /// + /// + /// 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>> ListInstancesAsResponseAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListInstancesArguments( + httpClient: HttpClient, + state: ref state, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListInstancesSecurityRequirements, + operationName: "ListInstancesAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListInstancesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + state: state, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "ListInstances", + methodName: "ListInstancesAsync", + 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: "ListInstances", + methodName: "ListInstancesAsync", + 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: "ListInstances", + methodName: "ListInstancesAsync", + 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); + ProcessListInstancesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInstances", + methodName: "ListInstancesAsync", + 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: "ListInstances", + methodName: "ListInstancesAsync", + 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); + ProcessListInstancesResponseContent( + 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.RenameInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.RenameInstance.g.cs new file mode 100644 index 00000000..c1d1ce34 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.RenameInstance.g.cs @@ -0,0 +1,612 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RenameInstanceSecurityRequirement0 = + 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_RenameInstanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RenameInstanceSecurityRequirement0, + }; + partial void PrepareRenameInstanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.AgentUpdateIn request); + partial void PrepareRenameInstanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.AgentUpdateIn request); + partial void ProcessRenameInstanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRenameInstanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Rename Instance + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RenameInstanceAsync( + string instanceId, + + global::DeepInfra.AgentUpdateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RenameInstanceAsResponseAsync( + instanceId: instanceId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Rename Instance + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RenameInstanceAsResponseAsync( + string instanceId, + + global::DeepInfra.AgentUpdateIn request, + string? xiApiKey = default, + 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); + PrepareRenameInstanceArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RenameInstanceSecurityRequirements, + operationName: "RenameInstanceAsync"); + + 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()); + } + 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); + PrepareRenameInstanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + 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: "RenameInstance", + methodName: "RenameInstanceAsync", + 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: "RenameInstance", + methodName: "RenameInstanceAsync", + 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: "RenameInstance", + methodName: "RenameInstanceAsync", + 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); + ProcessRenameInstanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RenameInstance", + methodName: "RenameInstanceAsync", + 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: "RenameInstance", + methodName: "RenameInstanceAsync", + 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); + ProcessRenameInstanceResponseContent( + 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(); + } + } + /// + /// Rename Instance + /// + /// + /// + /// + /// + /// 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 RenameInstanceAsync( + string instanceId, + string name, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AgentUpdateIn + { + Name = name, + }; + + return await RenameInstanceAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.RestoreBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.RestoreBackup.g.cs new file mode 100644 index 00000000..3d712994 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.RestoreBackup.g.cs @@ -0,0 +1,605 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RestoreBackupSecurityRequirement0 = + 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_RestoreBackupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RestoreBackupSecurityRequirement0, + }; + partial void PrepareRestoreBackupArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string backupId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareRestoreBackupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string backupId, + string? xiApiKey, + string? xApiKey); + partial void ProcessRestoreBackupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRestoreBackupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// 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 RestoreBackupAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RestoreBackupAsResponseAsync( + instanceId: instanceId, + backupId: backupId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// 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> RestoreBackupAsResponseAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRestoreBackupArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + backupId: ref backupId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RestoreBackupSecurityRequirements, + operationName: "RestoreBackupAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareRestoreBackupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + backupId: backupId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "RestoreBackup", + methodName: "RestoreBackupAsync", + 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: "RestoreBackup", + methodName: "RestoreBackupAsync", + 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: "RestoreBackup", + methodName: "RestoreBackupAsync", + 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); + ProcessRestoreBackupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RestoreBackup", + methodName: "RestoreBackupAsync", + 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: "RestoreBackup", + methodName: "RestoreBackupAsync", + 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); + ProcessRestoreBackupResponseContent( + 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.StartInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.StartInstance.g.cs new file mode 100644 index 00000000..975002a5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.StartInstance.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_StartInstanceSecurityRequirement0 = + 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_StartInstanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_StartInstanceSecurityRequirement0, + }; + partial void PrepareStartInstanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareStartInstanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessStartInstanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessStartInstanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Start Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task StartInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StartInstanceAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Start Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> StartInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStartInstanceArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StartInstanceSecurityRequirements, + operationName: "StartInstanceAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStartInstanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "StartInstance", + methodName: "StartInstanceAsync", + 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: "StartInstance", + methodName: "StartInstanceAsync", + 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: "StartInstance", + methodName: "StartInstanceAsync", + 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); + ProcessStartInstanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StartInstance", + methodName: "StartInstanceAsync", + 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: "StartInstance", + methodName: "StartInstanceAsync", + 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); + ProcessStartInstanceResponseContent( + 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.StopInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.StopInstance.g.cs new file mode 100644 index 00000000..b0a949b6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.StopInstance.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_StopInstanceSecurityRequirement0 = + 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_StopInstanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_StopInstanceSecurityRequirement0, + }; + partial void PrepareStopInstanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareStopInstanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessStopInstanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessStopInstanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Stop Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task StopInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StopInstanceAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Stop Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> StopInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStopInstanceArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StopInstanceSecurityRequirements, + operationName: "StopInstanceAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStopInstanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "StopInstance", + methodName: "StopInstanceAsync", + 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: "StopInstance", + methodName: "StopInstanceAsync", + 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: "StopInstance", + methodName: "StopInstanceAsync", + 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); + ProcessStopInstanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopInstance", + methodName: "StopInstanceAsync", + 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: "StopInstance", + methodName: "StopInstanceAsync", + 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); + ProcessStopInstanceResponseContent( + 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.UpdateInstanceVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.UpdateInstanceVersion.g.cs new file mode 100644 index 00000000..cdfbed1c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.UpdateInstanceVersion.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UpdateInstanceVersionSecurityRequirement0 = + 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_UpdateInstanceVersionSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UpdateInstanceVersionSecurityRequirement0, + }; + partial void PrepareUpdateInstanceVersionArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareUpdateInstanceVersionRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessUpdateInstanceVersionResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateInstanceVersionResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update Instance 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 UpdateInstanceVersionAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateInstanceVersionAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Instance 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> UpdateInstanceVersionAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUpdateInstanceVersionArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateInstanceVersionSecurityRequirements, + operationName: "UpdateInstanceVersionAsync"); + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateInstanceVersionRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + instanceId: instanceId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "UpdateInstanceVersion", + methodName: "UpdateInstanceVersionAsync", + 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: "UpdateInstanceVersion", + methodName: "UpdateInstanceVersionAsync", + 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: "UpdateInstanceVersion", + methodName: "UpdateInstanceVersionAsync", + 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); + ProcessUpdateInstanceVersionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateInstanceVersion", + methodName: "UpdateInstanceVersionAsync", + 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: "UpdateInstanceVersion", + methodName: "UpdateInstanceVersionAsync", + 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); + ProcessUpdateInstanceVersionResponseContent( + 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..2d9093b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.Json.g.cs index 652472d7..722d25e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs index d8950855..873d438e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public readonly partial struct AnyOf : global::System.IEquatable> { /// - /// + /// /// #if NET6_0_OR_GREATER public T1? Value1 { get; init; } @@ -18,7 +18,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] @@ -26,7 +26,27 @@ namespace DeepInfra 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; } @@ -35,24 +55,44 @@ namespace DeepInfra #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()}."); + /// + /// /// public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); /// - /// + /// /// public static implicit operator T1?(AnyOf @this) => @this.Value1; /// - /// + /// /// public AnyOf(T1? value) { @@ -60,17 +100,22 @@ public AnyOf(T1? 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) { @@ -78,7 +123,12 @@ public AnyOf(T2? value) } /// - /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + + /// + /// /// public AnyOf( T1? value1, @@ -90,23 +140,23 @@ public AnyOf( } /// - /// + /// /// public object? Object => Value2 as object ?? - Value1 as object + Value1 as object ; /// - /// + /// /// public override string? ToString() => Value1?.ToString() ?? - Value2?.ToString() + Value2?.ToString() ; /// - /// + /// /// public bool Validate() { @@ -114,7 +164,7 @@ public bool Validate() } /// - /// + /// /// public TResult? Match( global::System.Func? value1 = null, @@ -139,10 +189,34 @@ 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) { @@ -162,7 +236,7 @@ public void Match( } /// - /// + /// /// public override int GetHashCode() { @@ -183,18 +257,18 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null } /// - /// + /// /// 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(Value2, other.Value2) ; } /// - /// + /// /// public static bool operator ==(AnyOf obj1, AnyOf obj2) { @@ -202,7 +276,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public static bool operator !=(AnyOf obj1, AnyOf obj2) { @@ -210,7 +284,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public override bool Equals(object? obj) { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.Json.g.cs index b8ff4f0b..2a6257a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs index 1b628e9c..9fd40dc4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public readonly partial struct AnyOf : global::System.IEquatable> { /// - /// + /// /// #if NET6_0_OR_GREATER public T1? Value1 { get; init; } @@ -18,7 +18,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] @@ -26,7 +26,27 @@ namespace DeepInfra 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; } @@ -35,7 +55,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] @@ -43,7 +63,27 @@ namespace DeepInfra 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; } @@ -52,24 +92,44 @@ namespace DeepInfra #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()}."); + /// + /// /// public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); /// - /// + /// /// public static implicit operator T1?(AnyOf @this) => @this.Value1; /// - /// + /// /// public AnyOf(T1? value) { @@ -77,17 +137,22 @@ public AnyOf(T1? 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) { @@ -95,17 +160,22 @@ public AnyOf(T2? 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) { @@ -113,7 +183,12 @@ public AnyOf(T3? value) } /// - /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + + /// + /// /// public AnyOf( T1? value1, @@ -127,25 +202,25 @@ public AnyOf( } /// - /// + /// /// public object? Object => Value3 as object ?? Value2 as object ?? - Value1 as object + Value1 as object ; /// - /// + /// /// public override string? ToString() => Value1?.ToString() ?? Value2?.ToString() ?? - Value3?.ToString() + Value3?.ToString() ; /// - /// + /// /// public bool Validate() { @@ -153,7 +228,7 @@ public bool Validate() } /// - /// + /// /// public TResult? Match( global::System.Func? value1 = null, @@ -183,10 +258,40 @@ 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) @@ -211,7 +316,7 @@ public void Match( } /// - /// + /// /// public override int GetHashCode() { @@ -234,19 +339,19 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null } /// - /// + /// /// 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(Value3, other.Value3) ; } /// - /// + /// /// public static bool operator ==(AnyOf obj1, AnyOf obj2) { @@ -254,7 +359,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public static bool operator !=(AnyOf obj1, AnyOf obj2) { @@ -262,7 +367,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public override bool Equals(object? obj) { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.Json.g.cs index f4266c04..d9ecf4e7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs index e3ca5bbd..a182c797 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public readonly partial struct AnyOf : global::System.IEquatable> { /// - /// + /// /// #if NET6_0_OR_GREATER public T1? Value1 { get; init; } @@ -18,7 +18,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] @@ -26,7 +26,27 @@ namespace DeepInfra 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; } @@ -35,7 +55,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] @@ -43,7 +63,27 @@ namespace DeepInfra 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; } @@ -52,7 +92,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] @@ -60,7 +100,27 @@ namespace DeepInfra 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; } @@ -69,24 +129,44 @@ namespace DeepInfra #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()}."); + /// + /// /// public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); /// - /// + /// /// public static implicit operator T1?(AnyOf @this) => @this.Value1; /// - /// + /// /// public AnyOf(T1? value) { @@ -94,17 +174,22 @@ public AnyOf(T1? 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) { @@ -112,17 +197,22 @@ public AnyOf(T2? 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) { @@ -130,17 +220,22 @@ public AnyOf(T3? 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) { @@ -148,7 +243,12 @@ public AnyOf(T4? value) } /// - /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + + /// + /// /// public AnyOf( T1? value1, @@ -164,27 +264,27 @@ public AnyOf( } /// - /// + /// /// public object? Object => Value4 as object ?? Value3 as object ?? Value2 as object ?? - Value1 as object + Value1 as object ; /// - /// + /// /// public override string? ToString() => Value1?.ToString() ?? Value2?.ToString() ?? Value3?.ToString() ?? - Value4?.ToString() + Value4?.ToString() ; /// - /// + /// /// public bool Validate() { @@ -192,7 +292,7 @@ public bool Validate() } /// - /// + /// /// public TResult? Match( global::System.Func? value1 = null, @@ -227,10 +327,46 @@ 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, @@ -260,7 +396,7 @@ public void Match( } /// - /// + /// /// public override int GetHashCode() { @@ -285,7 +421,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null } /// - /// + /// /// public bool Equals(AnyOf other) { @@ -293,12 +429,12 @@ public bool Equals(AnyOf other) 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(Value4, other.Value4) ; } /// - /// + /// /// public static bool operator ==(AnyOf obj1, AnyOf obj2) { @@ -306,7 +442,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public static bool operator !=(AnyOf obj1, AnyOf obj2) { @@ -314,7 +450,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public override bool Equals(object? obj) { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.Json.g.cs index b9082d9a..c84c650a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize>( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs index 77f3bd98..797acc24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public readonly partial struct AnyOf : global::System.IEquatable> { /// - /// + /// /// #if NET6_0_OR_GREATER public T1? Value1 { get; init; } @@ -18,7 +18,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] @@ -26,7 +26,27 @@ namespace DeepInfra 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; } @@ -35,7 +55,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] @@ -43,7 +63,27 @@ namespace DeepInfra 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; } @@ -52,7 +92,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] @@ -60,7 +100,27 @@ namespace DeepInfra 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; } @@ -69,7 +129,7 @@ namespace DeepInfra #endif /// - /// + /// /// #if NET6_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] @@ -77,7 +137,27 @@ namespace DeepInfra 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; } @@ -86,24 +166,44 @@ namespace DeepInfra #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()}."); + /// + /// /// public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); /// - /// + /// /// public static implicit operator T1?(AnyOf @this) => @this.Value1; /// - /// + /// /// public AnyOf(T1? value) { @@ -111,17 +211,22 @@ public AnyOf(T1? 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) { @@ -129,17 +234,22 @@ public AnyOf(T2? 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) { @@ -147,17 +257,22 @@ public AnyOf(T3? 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) { @@ -165,17 +280,22 @@ public AnyOf(T4? 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) { @@ -183,7 +303,12 @@ public AnyOf(T5? value) } /// - /// + /// + /// + public static AnyOf FromValue5(T5? value) => new AnyOf(value); + + /// + /// /// public AnyOf( T1? value1, @@ -201,29 +326,29 @@ public AnyOf( } /// - /// + /// /// public object? Object => Value5 as object ?? Value4 as object ?? Value3 as object ?? Value2 as object ?? - Value1 as object + Value1 as object ; /// - /// + /// /// public override string? ToString() => Value1?.ToString() ?? Value2?.ToString() ?? Value3?.ToString() ?? Value4?.ToString() ?? - Value5?.ToString() + Value5?.ToString() ; /// - /// + /// /// public bool Validate() { @@ -231,7 +356,7 @@ public bool Validate() } /// - /// + /// /// public TResult? Match( global::System.Func? value1 = null, @@ -271,10 +396,52 @@ 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, @@ -309,7 +476,7 @@ public void Match( } /// - /// + /// /// public override int GetHashCode() { @@ -336,7 +503,7 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null } /// - /// + /// /// public bool Equals(AnyOf other) { @@ -345,12 +512,12 @@ public bool Equals(AnyOf other) 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(Value5, other.Value5) ; } /// - /// + /// /// public static bool operator ==(AnyOf obj1, AnyOf obj2) { @@ -358,7 +525,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public static bool operator !=(AnyOf obj1, AnyOf obj2) { @@ -366,7 +533,7 @@ public bool Equals(AnyOf other) } /// - /// + /// /// public override bool Equals(object? obj) { 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..7514c76a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnyOf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AnyOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize>( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AnyOf), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..751c86b3 --- /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..9a124137 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs @@ -0,0 +1,580 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.OpenAITextToSpeechIn request); + partial void PrepareOpenaiAudioSpeechRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiAudioSpeechAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiAudioSpeechArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareOpenaiAudioSpeechRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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: "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. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// 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, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = 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, + FailFast = failFast, + Model = model, + Input = input, + Voice = voice, + ResponseFormat = responseFormat, + Speed = speed, + ExtraBody = extraBody, + }; + + return await OpenaiAudioSpeechAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..0b71aedd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranscriptions.g.cs @@ -0,0 +1,1748 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); + partial void PrepareOpenaiAudioTranscriptionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiAudioTranscriptionsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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\""); + + } + if (request.ServiceTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ServiceTier ?? string.Empty), + name: "\"service_tier\""); + + } + + __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, + 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: "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? xApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + string? serviceTier = 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, + ServiceTier = serviceTier, + }; + + return await OpenaiAudioTranscriptionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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? xApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + string? serviceTier = 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, + ServiceTier = serviceTier, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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\""); + + } + if (request.ServiceTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ServiceTier ?? string.Empty), + name: "\"service_tier\""); + + } + + __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, + 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: "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? xApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + string? serviceTier = 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, + ServiceTier = serviceTier, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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\""); + + } + if (request.ServiceTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ServiceTier ?? string.Empty), + name: "\"service_tier\""); + + } + + __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, + 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: "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..87e0d401 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranslations.g.cs @@ -0,0 +1,1682 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); + partial void PrepareOpenaiAudioTranslationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiAudioTranslationsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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\""); + + } + if (request.ServiceTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ServiceTier ?? string.Empty), + name: "\"service_tier\""); + + } + + __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, + 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: "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? xApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + string? serviceTier = 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, + ServiceTier = serviceTier, + }; + + return await OpenaiAudioTranslationsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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? xApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + string? serviceTier = 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, + ServiceTier = serviceTier, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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\""); + + } + if (request.ServiceTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ServiceTier ?? string.Empty), + name: "\"service_tier\""); + + } + + __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, + 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: "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? xApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + string? serviceTier = 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, + ServiceTier = serviceTier, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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\""); + + } + if (request.ServiceTier != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ServiceTier ?? string.Empty), + name: "\"service_tier\""); + + } + + __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, + 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: "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..dcac23f9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..89253163 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateApiToken.g.cs @@ -0,0 +1,565 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ApiTokenIn request); + partial void PrepareCreateApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateApiTokenAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareCreateApiTokenArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareCreateApiTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..1179d4f2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateScopedJwt.g.cs @@ -0,0 +1,548 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ScopedJWTIn request); + partial void PrepareCreateScopedJwtRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateScopedJwtAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareCreateScopedJwtArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareCreateScopedJwtRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..9336f956 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateSshKey.g.cs @@ -0,0 +1,572 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.SshKeyIn request); + partial void PrepareCreateSshKeyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSshKeyAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareCreateSshKeyArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareCreateSshKeyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..4a69c62e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteApiToken.g.cs @@ -0,0 +1,522 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeleteApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteApiTokenAsResponseAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteApiTokenArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..621b02eb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.DeleteSshKey.g.cs @@ -0,0 +1,522 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeleteSshKeyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sshKeyId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteSshKeyAsResponseAsync( + sshKeyId: sshKeyId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteSshKeyArguments( + httpClient: HttpClient, + sshKeyId: ref sshKeyId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..a5f69332 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.ExportApiTokenToVercel.g.cs @@ -0,0 +1,585 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ApiTokenVercelExportIn request); + partial void PrepareExportApiTokenToVercelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExportApiTokenToVercelAsResponseAsync( + apiToken: apiToken, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareExportApiTokenToVercelArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareExportApiTokenToVercelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiToken: apiToken!, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..b9534785 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiToken.g.cs @@ -0,0 +1,526 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApiTokenAsResponseAsync( + apiToken: apiToken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetApiTokenArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..a64846e1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetApiTokens.g.cs @@ -0,0 +1,480 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetApiTokensRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetApiTokensAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetApiTokensArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..64271ebb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GetSshKeys.g.cs @@ -0,0 +1,480 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetSshKeysRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSshKeysAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetSshKeysArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..31392fe5 --- /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..54274665 --- /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.GoogleLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GoogleLogin.g.cs new file mode 100644 index 00000000..2398b1be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GoogleLogin.g.cs @@ -0,0 +1,492 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GoogleLoginSecurityRequirement0 = + 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_GoogleLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GoogleLoginSecurityRequirement0, + }; + partial void PrepareGoogleLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? loginId, + ref string? origin, + ref string? deal, + ref string? tiToken); + partial void PrepareGoogleLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? loginId, + string? origin, + string? deal, + string? tiToken); + partial void ProcessGoogleLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGoogleLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Google Login
+ /// Initiate Google SSO login flow. Callback is /google/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 GoogleLoginAsync( + 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 GoogleLoginAsResponseAsync( + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Google Login
+ /// Initiate Google SSO login flow. Callback is /google/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> GoogleLoginAsResponseAsync( + 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); + PrepareGoogleLoginArguments( + httpClient: HttpClient, + loginId: ref loginId, + origin: ref origin, + deal: ref deal, + tiToken: ref tiToken); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GoogleLoginSecurityRequirements, + operationName: "GoogleLoginAsync"); + + 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: "/google/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); + PrepareGoogleLoginRequest( + 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: "GoogleLogin", + methodName: "GoogleLoginAsync", + pathTemplate: "\"/google/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: "GoogleLogin", + methodName: "GoogleLoginAsync", + pathTemplate: "\"/google/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: "GoogleLogin", + methodName: "GoogleLoginAsync", + pathTemplate: "\"/google/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); + ProcessGoogleLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GoogleLogin", + methodName: "GoogleLoginAsync", + pathTemplate: "\"/google/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: "GoogleLogin", + methodName: "GoogleLoginAsync", + pathTemplate: "\"/google/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); + ProcessGoogleLoginResponseContent( + 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..cf45d036 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.InspectScopedJwt.g.cs @@ -0,0 +1,492 @@ + +#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, + ref string? xApiKey); + partial void PrepareInspectScopedJwtRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string jwtoken, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InspectScopedJwtAsResponseAsync( + jwtoken: jwtoken, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInspectScopedJwtArguments( + httpClient: HttpClient, + jwtoken: ref jwtoken, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..7365b0f4 --- /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..e24af8d9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..55f89b67 --- /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..ca95de40 --- /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..59a3900f --- /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..43f28bb7 --- /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..52bf9dc3 --- /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..e71b1aa1 --- /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..7bae69a4 --- /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..8862cd4b --- /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..2e64e1ae --- /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..861be95c --- /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..99cef30c --- /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..f398d466 --- /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..ddbb3005 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..abcb6c78 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs @@ -0,0 +1,647 @@ + +#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? anthropicVersion, + ref string? anthropicBeta, + ref string? xDeepinfraSource, + ref string? xDeepinfraServiceTier, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.AnthropicMessagesIn request); + partial void PrepareAnthropicMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? anthropicVersion, + string? anthropicBeta, + string? xDeepinfraSource, + string? xDeepinfraServiceTier, + string? xiApiKey, + string? xApiKey, + 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? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xDeepinfraServiceTier = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnthropicMessagesAsResponseAsync( + + request: request, + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + xDeepinfraServiceTier: xDeepinfraServiceTier, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xDeepinfraServiceTier = default, + string? xiApiKey = default, + 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); + PrepareAnthropicMessagesArguments( + httpClient: HttpClient, + anthropicVersion: ref anthropicVersion, + anthropicBeta: ref anthropicBeta, + xDeepinfraSource: ref xDeepinfraSource, + xDeepinfraServiceTier: ref xDeepinfraServiceTier, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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 (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()); + } + if (xDeepinfraServiceTier != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-service-tier", xDeepinfraServiceTier.ToString()); + } + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareAnthropicMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + xDeepinfraServiceTier: xDeepinfraServiceTier, + xiApiKey: xiApiKey, + 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: "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 + /// + /// + /// + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + /// + /// + /// + /// + /// + /// + /// 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? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xDeepinfraServiceTier = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::System.Collections.Generic.IList? models = 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, + string? promptCacheKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AnthropicMessagesIn + { + ServiceTier = serviceTier, + FailFast = failFast, + Models = models, + 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, + PromptCacheKey = promptCacheKey, + }; + + return await AnthropicMessagesAsync( + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + xDeepinfraServiceTier: xDeepinfraServiceTier, + xiApiKey: xiApiKey, + 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.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessagesCountTokens.g.cs new file mode 100644 index 00000000..5b4375a5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessagesCountTokens.g.cs @@ -0,0 +1,539 @@ + +#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? xiApiKey, + ref string? xApiKey, + global::DeepInfra.AnthropicTokenCountRequest request); + partial void PrepareAnthropicMessagesCountTokensRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + 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? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AnthropicMessagesCountTokensAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + 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? xiApiKey = default, + 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, + xiApiKey: ref xiApiKey, + 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 (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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, + xiApiKey: xiApiKey, + 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? xiApiKey = default, + 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( + xiApiKey: xiApiKey, + 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..492c4522 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.OpenaiChatCompletions.g.cs @@ -0,0 +1,703 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.OpenAIChatCompletionsIn request); + partial void PrepareOpenaiChatCompletionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiChatCompletionsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiChatCompletionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareOpenaiChatCompletionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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: "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 + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + /// + /// 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 65536, 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, minimal, low, medium, high, xhigh, and max. 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. + /// + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + /// + /// 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. + /// + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// + /// Per-request overrides 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, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::System.Collections.Generic.IList? models = 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, + global::DeepInfra.PromptCacheOptions? promptCacheOptions = default, + object? chatTemplateKwargs = default, + bool? continueFinalMessage = default, + bool? ignoreEos = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAIChatCompletionsIn + { + ServiceTier = serviceTier, + FailFast = failFast, + Models = models, + 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, + PromptCacheOptions = promptCacheOptions, + ChatTemplateKwargs = chatTemplateKwargs, + ContinueFinalMessage = continueFinalMessage, + IgnoreEos = ignoreEos, + }; + + return await OpenaiChatCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.g.cs new file mode 100644 index 00000000..120072af --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.DeployArgsHistory.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployArgsHistory.g.cs new file mode 100644 index 00000000..fa60a9b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployArgsHistory.g.cs @@ -0,0 +1,600 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployArgsHistorySecurityRequirement0 = + 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_DeployArgsHistorySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployArgsHistorySecurityRequirement0, + }; + partial void PrepareDeployArgsHistoryArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeployArgsHistoryRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeployArgsHistoryResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployArgsHistoryResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Args History + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeployArgsHistoryAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployArgsHistoryAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Args History + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> DeployArgsHistoryAsResponseAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployArgsHistoryArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployArgsHistorySecurityRequirements, + operationName: "DeployArgsHistoryAsync"); + + 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}/config/history", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployArgsHistoryRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeployArgsHistory", + methodName: "DeployArgsHistoryAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history\"", + 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: "DeployArgsHistory", + methodName: "DeployArgsHistoryAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history\"", + 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: "DeployArgsHistory", + methodName: "DeployArgsHistoryAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history\"", + 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); + ProcessDeployArgsHistoryResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployArgsHistory", + methodName: "DeployArgsHistoryAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history\"", + 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: "DeployArgsHistory", + methodName: "DeployArgsHistoryAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history\"", + 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)); + } + // 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); + ProcessDeployArgsHistoryResponseContent( + 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.DeployArgsRestore.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployArgsRestore.g.cs new file mode 100644 index 00000000..cd8e8742 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployArgsRestore.g.cs @@ -0,0 +1,646 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployArgsRestoreSecurityRequirement0 = + 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_DeployArgsRestoreSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployArgsRestoreSecurityRequirement0, + }; + partial void PrepareDeployArgsRestoreArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string entryId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeployArgsRestoreRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string entryId, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeployArgsRestoreResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployArgsRestoreResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Args Restore + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeployArgsRestoreAsync( + string deployId, + string entryId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployArgsRestoreAsResponseAsync( + deployId: deployId, + entryId: entryId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Args Restore + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeployArgsRestoreAsResponseAsync( + string deployId, + string entryId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployArgsRestoreArguments( + httpClient: HttpClient, + deployId: ref deployId, + entryId: ref entryId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployArgsRestoreSecurityRequirements, + operationName: "DeployArgsRestoreAsync"); + + 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}/config/history/{entryId}/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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployArgsRestoreRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + entryId: entryId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeployArgsRestore", + methodName: "DeployArgsRestoreAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history/{entryId}/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: "DeployArgsRestore", + methodName: "DeployArgsRestoreAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history/{entryId}/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: "DeployArgsRestore", + methodName: "DeployArgsRestoreAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history/{entryId}/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); + ProcessDeployArgsRestoreResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployArgsRestore", + methodName: "DeployArgsRestoreAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history/{entryId}/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: "DeployArgsRestore", + methodName: "DeployArgsRestoreAsync", + pathTemplate: "$\"/deploy/{deployId}/config/history/{entryId}/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); + } + // 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)); + } + // 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); + ProcessDeployArgsRestoreResponseContent( + 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.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs new file mode 100644 index 00000000..71b8263f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs @@ -0,0 +1,652 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.DeployModelIn request); + partial void PrepareDeployCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployCreateAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareDeployCreateArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareDeployCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..a84d9b31 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateHf.g.cs @@ -0,0 +1,646 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.HFModel request); + partial void PrepareDeployCreateHfRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployCreateHfAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareDeployCreateHfArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareDeployCreateHfRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..c51691c2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateLlm.g.cs @@ -0,0 +1,683 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.DeployLLMIn request); + partial void PrepareDeployCreateLlmRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployCreateLlmAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareDeployCreateLlmArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareDeployCreateLlmRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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)); + } + // 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); + 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 + /// + /// + /// + /// Base public model + /// + /// + /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) + /// + /// + /// + /// Extra command line arguments for custom deployments + /// + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. Unset knobs use the model/engine defaults. + /// + /// + /// Apply a stored preset or vLLM recipe by id. A non-empty standard_args or extra_args in this request replaces the preset's whole matching field. + /// + /// Per-request overrides 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, + string? xApiKey = default, + int? numGpus = 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.StandardArgs? standardArgs = default, + string? presetId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeployLLMIn + { + ModelName = modelName, + Gpu = gpu, + NumGpus = numGpus, + Hf = hf, + BaseModel = baseModel, + ContainerImage = containerImage, + Settings = settings, + ExtraArgs = extraArgs, + StandardArgs = standardArgs, + PresetId = presetId, + }; + + return await DeployCreateLlmAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..813360f6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDelete.g.cs @@ -0,0 +1,563 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployDeleteAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployDeleteArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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)); + } + // 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); + 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..5d49e888 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDetailedStats.g.cs @@ -0,0 +1,595 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployDetailedStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string from, + string? to, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployDetailedStatsAsResponseAsync( + deployId: deployId, + from: from, + to: to, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..4657b734 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployGpuAvailability.g.cs @@ -0,0 +1,502 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployGpuAvailabilityRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? source, + string? baseModel, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployGpuAvailabilityAsResponseAsync( + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..50177964 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployList2.g.cs @@ -0,0 +1,533 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployList2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? status, + string? xiApiKey, + string? xApiKey); + 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,updating,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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployList2AsResponseAsync( + status: status, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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,updating,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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployList2Arguments( + httpClient: HttpClient, + status: ref status, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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.DeployLlmPresets.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmPresets.g.cs new file mode 100644 index 00000000..3d5da9df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmPresets.g.cs @@ -0,0 +1,526 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployLlmPresetsSecurityRequirement0 = + 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_DeployLlmPresetsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployLlmPresetsSecurityRequirement0, + }; + partial void PrepareDeployLlmPresetsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string hfRepoId, + ref global::DeepInfra.DeployGPUs? gpu, + ref string? engine, + ref string? source, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeployLlmPresetsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string hfRepoId, + global::DeepInfra.DeployGPUs? gpu, + string? engine, + string? source, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeployLlmPresetsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployLlmPresetsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Llm Presets
+ /// DeepInfra presets and mirrored vLLM recipes for ``hf_repo_id``, told apart by
+ /// ``source``; empty when none. Filter by ``gpu``/``engine``/``source``. + ///
+ /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeployLlmPresetsAsync( + string hfRepoId, + global::DeepInfra.DeployGPUs? gpu = default, + string? engine = default, + string? source = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployLlmPresetsAsResponseAsync( + hfRepoId: hfRepoId, + gpu: gpu, + engine: engine, + source: source, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Llm Presets
+ /// DeepInfra presets and mirrored vLLM recipes for ``hf_repo_id``, told apart by
+ /// ``source``; empty when none. Filter by ``gpu``/``engine``/``source``. + ///
+ /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> DeployLlmPresetsAsResponseAsync( + string hfRepoId, + global::DeepInfra.DeployGPUs? gpu = default, + string? engine = default, + string? source = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployLlmPresetsArguments( + httpClient: HttpClient, + hfRepoId: ref hfRepoId, + gpu: ref gpu, + engine: ref engine, + source: ref source, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployLlmPresetsSecurityRequirements, + operationName: "DeployLlmPresetsAsync"); + + 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/presets", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("hf_repo_id", hfRepoId) + .AddOptionalParameter("gpu", gpu?.ToString()) + .AddOptionalParameter("engine", engine) + .AddOptionalParameter("source", source) + ; + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployLlmPresetsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + hfRepoId: hfRepoId!, + gpu: gpu, + engine: engine, + source: source, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeployLlmPresets", + methodName: "DeployLlmPresetsAsync", + pathTemplate: "\"/deploy/llm/presets\"", + 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: "DeployLlmPresets", + methodName: "DeployLlmPresetsAsync", + pathTemplate: "\"/deploy/llm/presets\"", + 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: "DeployLlmPresets", + methodName: "DeployLlmPresetsAsync", + pathTemplate: "\"/deploy/llm/presets\"", + 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); + ProcessDeployLlmPresetsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmPresets", + methodName: "DeployLlmPresetsAsync", + pathTemplate: "\"/deploy/llm/presets\"", + 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: "DeployLlmPresets", + methodName: "DeployLlmPresetsAsync", + pathTemplate: "\"/deploy/llm/presets\"", + 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); + } + // 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); + ProcessDeployLlmPresetsResponseContent( + 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.DeployLlmStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmStandardArgs.g.cs new file mode 100644 index 00000000..1b3041f5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmStandardArgs.g.cs @@ -0,0 +1,492 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployLlmStandardArgsSecurityRequirement0 = + 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_DeployLlmStandardArgsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployLlmStandardArgsSecurityRequirement0, + }; + partial void PrepareDeployLlmStandardArgsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? engine, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeployLlmStandardArgsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? engine, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeployLlmStandardArgsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployLlmStandardArgsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Llm Standard Args + /// + /// + /// Default Value: vllm + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeployLlmStandardArgsAsync( + string? engine = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployLlmStandardArgsAsResponseAsync( + engine: engine, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Llm Standard Args + /// + /// + /// Default Value: vllm + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeployLlmStandardArgsAsResponseAsync( + string? engine = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployLlmStandardArgsArguments( + httpClient: HttpClient, + engine: ref engine, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployLlmStandardArgsSecurityRequirements, + operationName: "DeployLlmStandardArgsAsync"); + + 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/standard_args", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("engine", engine) + ; + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployLlmStandardArgsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + engine: engine, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeployLlmStandardArgs", + methodName: "DeployLlmStandardArgsAsync", + pathTemplate: "\"/deploy/llm/standard_args\"", + 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: "DeployLlmStandardArgs", + methodName: "DeployLlmStandardArgsAsync", + pathTemplate: "\"/deploy/llm/standard_args\"", + 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: "DeployLlmStandardArgs", + methodName: "DeployLlmStandardArgsAsync", + pathTemplate: "\"/deploy/llm/standard_args\"", + 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); + ProcessDeployLlmStandardArgsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployLlmStandardArgs", + methodName: "DeployLlmStandardArgsAsync", + pathTemplate: "\"/deploy/llm/standard_args\"", + 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: "DeployLlmStandardArgs", + methodName: "DeployLlmStandardArgsAsync", + pathTemplate: "\"/deploy/llm/standard_args\"", + 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); + } + // 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); + ProcessDeployLlmStandardArgsResponseContent( + 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.DedicatedModelsClient.DeployLlmSuggestName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmSuggestName.g.cs new file mode 100644 index 00000000..e890f69c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmSuggestName.g.cs @@ -0,0 +1,529 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployLlmSuggestNameRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployLlmSuggestNameAsResponseAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployLlmSuggestNameArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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.DeployRebalance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalance.g.cs new file mode 100644 index 00000000..5e420761 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalance.g.cs @@ -0,0 +1,747 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployRebalanceSecurityRequirement0 = + 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_DeployRebalanceSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployRebalanceSecurityRequirement0, + }; + partial void PrepareDeployRebalanceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.RebalanceIn request); + partial void PrepareDeployRebalanceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.RebalanceIn request); + partial void ProcessDeployRebalanceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployRebalanceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Rebalance
+ /// Start a GPU pool rebalance: move GPUs from this deployment onto another
+ /// deployment you own, one instance at a time and without downtime. Moving all
+ /// instances stops this deployment; start it again later to resume 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 DeployRebalanceAsync( + string deployId, + + global::DeepInfra.RebalanceIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployRebalanceAsResponseAsync( + deployId: deployId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Rebalance
+ /// Start a GPU pool rebalance: move GPUs from this deployment onto another
+ /// deployment you own, one instance at a time and without downtime. Moving all
+ /// instances stops this deployment; start it again later to resume 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> DeployRebalanceAsResponseAsync( + string deployId, + + global::DeepInfra.RebalanceIn request, + string? xiApiKey = default, + 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); + PrepareDeployRebalanceArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployRebalanceSecurityRequirements, + operationName: "DeployRebalanceAsync"); + + 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}/rebalance", + 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()); + } + 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); + PrepareDeployRebalanceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey, + 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: "DeployRebalance", + methodName: "DeployRebalanceAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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: "DeployRebalance", + methodName: "DeployRebalanceAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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: "DeployRebalance", + methodName: "DeployRebalanceAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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); + ProcessDeployRebalanceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployRebalance", + methodName: "DeployRebalanceAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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: "DeployRebalance", + methodName: "DeployRebalanceAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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)); + } + // 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)); + } + // 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); + ProcessDeployRebalanceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.RebalanceOut.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.RebalanceOut.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 Rebalance
+ /// Start a GPU pool rebalance: move GPUs from this deployment onto another
+ /// deployment you own, one instance at a time and without downtime. Moving all
+ /// instances stops this deployment; start it again later to resume it. + ///
+ /// + /// + /// + /// + /// Deployment to grow using GPUs freed from this one. + /// + /// + /// Number of target instances to create. + /// + /// + /// Validate and preview without moving anything.
+ /// 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 DeployRebalanceAsync( + string deployId, + string targetDeployId, + int count, + string? xiApiKey = default, + string? xApiKey = default, + bool? dryRun = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.RebalanceIn + { + TargetDeployId = targetDeployId, + Count = count, + DryRun = dryRun, + }; + + return await DeployRebalanceAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalanceCancel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalanceCancel.g.cs new file mode 100644 index 00000000..2aebd35e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalanceCancel.g.cs @@ -0,0 +1,691 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployRebalanceCancelSecurityRequirement0 = + 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_DeployRebalanceCancelSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployRebalanceCancelSecurityRequirement0, + }; + partial void PrepareDeployRebalanceCancelArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.RebalanceCancelIn request); + partial void PrepareDeployRebalanceCancelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.RebalanceCancelIn request); + partial void ProcessDeployRebalanceCancelResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployRebalanceCancelResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Rebalance Cancel
+ /// Stop an in-flight GPU pool rebalance; instances already moved stay, and
+ /// both deployments keep min/max instances fixed at their current counts. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeployRebalanceCancelAsync( + string deployId, + + global::DeepInfra.RebalanceCancelIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployRebalanceCancelAsResponseAsync( + deployId: deployId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Rebalance Cancel
+ /// Stop an in-flight GPU pool rebalance; instances already moved stay, and
+ /// both deployments keep min/max instances fixed at their current counts. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeployRebalanceCancelAsResponseAsync( + string deployId, + + global::DeepInfra.RebalanceCancelIn request, + string? xiApiKey = default, + 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); + PrepareDeployRebalanceCancelArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployRebalanceCancelSecurityRequirements, + operationName: "DeployRebalanceCancelAsync"); + + 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}/rebalance/cancel", + 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()); + } + 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); + PrepareDeployRebalanceCancelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey, + 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: "DeployRebalanceCancel", + methodName: "DeployRebalanceCancelAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance/cancel\"", + 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: "DeployRebalanceCancel", + methodName: "DeployRebalanceCancelAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance/cancel\"", + 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: "DeployRebalanceCancel", + methodName: "DeployRebalanceCancelAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance/cancel\"", + 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); + ProcessDeployRebalanceCancelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployRebalanceCancel", + methodName: "DeployRebalanceCancelAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance/cancel\"", + 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: "DeployRebalanceCancel", + methodName: "DeployRebalanceCancelAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance/cancel\"", + 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)); + } + // 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); + ProcessDeployRebalanceCancelResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.RebalanceCancelOut.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.RebalanceCancelOut.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 Rebalance Cancel
+ /// Stop an in-flight GPU pool rebalance; instances already moved stay, and
+ /// both deployments keep min/max instances fixed at their current counts. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeployRebalanceCancelAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.RebalanceCancelIn + { + }; + + return await DeployRebalanceCancelAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalanceStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalanceStatus.g.cs new file mode 100644 index 00000000..a266cff8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployRebalanceStatus.g.cs @@ -0,0 +1,608 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class DedicatedModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeployRebalanceStatusSecurityRequirement0 = + 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_DeployRebalanceStatusSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeployRebalanceStatusSecurityRequirement0, + }; + partial void PrepareDeployRebalanceStatusArguments( + global::System.Net.Http.HttpClient httpClient, + ref string deployId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeployRebalanceStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeployRebalanceStatusResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeployRebalanceStatusResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deploy Rebalance Status
+ /// Status of GPU pool rebalances touching this deployment. A just-started
+ /// rebalance can take a moment to appear. A finished or cancelled rebalance
+ /// leaves both deployments' min/max instances fixed at the final counts; edit
+ /// them to resume autoscaling. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeployRebalanceStatusAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployRebalanceStatusAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Rebalance Status
+ /// Status of GPU pool rebalances touching this deployment. A just-started
+ /// rebalance can take a moment to appear. A finished or cancelled rebalance
+ /// leaves both deployments' min/max instances fixed at the final counts; edit
+ /// them to resume autoscaling. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeployRebalanceStatusAsResponseAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployRebalanceStatusArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeployRebalanceStatusSecurityRequirements, + operationName: "DeployRebalanceStatusAsync"); + + 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}/rebalance", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeployRebalanceStatusRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeployRebalanceStatus", + methodName: "DeployRebalanceStatusAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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: "DeployRebalanceStatus", + methodName: "DeployRebalanceStatusAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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: "DeployRebalanceStatus", + methodName: "DeployRebalanceStatusAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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); + ProcessDeployRebalanceStatusResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeployRebalanceStatus", + methodName: "DeployRebalanceStatusAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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: "DeployRebalanceStatus", + methodName: "DeployRebalanceStatusAsync", + pathTemplate: "$\"/deploy/{deployId}/rebalance\"", + 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)); + } + // 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); + ProcessDeployRebalanceStatusResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.RebalanceStatusOut.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.RebalanceStatusOut.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..2cfe1a8e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStart.g.cs @@ -0,0 +1,602 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployStartRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStartAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStartArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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)); + } + // 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); + 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..42bcffbb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStats.g.cs @@ -0,0 +1,595 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string from, + string? to, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStatsAsResponseAsync( + deployId: deployId, + from: from, + to: to, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..701f5c7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStatus.g.cs @@ -0,0 +1,526 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStatusAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStatusArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..ad7183a5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStop.g.cs @@ -0,0 +1,602 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeployStopRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployStopAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeployStopArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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)); + } + // 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); + 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..6fad14e7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployUpdate.g.cs @@ -0,0 +1,698 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.DeployLLMUpdateIn request); + partial void PrepareDeployUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeployUpdateAsResponseAsync( + deployId: deployId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareDeployUpdateArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareDeployUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + deployId: deployId!, + xiApiKey: xiApiKey, + 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: "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)); + } + // 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); + 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 + /// + /// + /// + /// + /// + /// + /// Engine tuning knobs. Replaces the whole set; omitted knobs are cleared. + /// + /// + /// Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared. + /// + /// Per-request overrides 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, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ScaleSettings? settings = default, + global::DeepInfra.StandardArgs? standardArgs = default, + global::System.Collections.Generic.IList? extraArgs = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeployLLMUpdateIn + { + Settings = settings, + StandardArgs = standardArgs, + ExtraArgs = extraArgs, + }; + + return await DeployUpdateAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..76ae144f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeploymentStats.g.cs @@ -0,0 +1,512 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeploymentStatsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string from, + string? to, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeploymentStatsAsResponseAsync( + from: from, + to: to, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..02072e13 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..b977f5e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs @@ -4,13 +4,14 @@ 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. ///
public sealed partial class DeepInfraClient : global::DeepInfra.IDeepInfraClient, global::System.IDisposable { /// - /// + /// /// public const string DefaultBaseUrl = "https://api.deepinfra.com/"; @@ -30,12 +31,211 @@ public sealed partial class DeepInfraClient : global::DeepInfra.IDeepInfraClient #if DEBUG = true; #endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + /// - /// + /// /// - public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + /// + /// User profile, team management, and rate limits. + /// + public AccountClient Account => new AccountClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Manage agent-framework instances (OpenClaw and friends). + /// + public AgentsClient Agents => new AgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// OpenAI-compatible speech synthesis, transcription, and translation. + /// + public AudioClient Audio => new AudioClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// API tokens, SSH keys, scoped JWTs, and login flows. + /// + public AuthenticationClient Authentication => new AuthenticationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Payment methods, usage tracking, and billing. + /// + public BillingClient Billing => new BillingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs. + /// + public ChatCompletionsClient ChatCompletions => new ChatCompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Deploy and manage private model instances with autoscaling. + /// + public DedicatedModelsClient DedicatedModels => new DedicatedModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Generate text embeddings for search and RAG. + /// + public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// File uploads and batch processing. + /// + public FilesBatchesClient FilesBatches => new FilesBatchesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Rent dedicated GPU containers. + /// + public GpuRentalsClient GpuRentals => new GpuRentalsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Generate, edit, and create variations of images. + /// + public ImageGenerationClient ImageGeneration => new ImageGenerationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Native DeepInfra inference API for models and deployments. + /// + public InferenceClient Inference => new InferenceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Create, manage, and query LoRA adapter models. + /// + public LoRAAdaptersClient LoRAAdapters => new LoRAAdaptersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Query inference logs, deployment logs, and usage metrics. + /// + public LogsMetricsClient LogsMetrics => new LogsMetricsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Browse, search, and manage AI models. + /// + public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Create and manage isolated sandbox environments. + /// + public SandboxesClient Sandboxes => new SandboxesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// OpenAI-compatible text completion endpoints. + /// + public TextCompletionsClient TextCompletions => new TextCompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// ElevenLabs-compatible TTS endpoints and voice management. + /// + public TextToSpeechClient TextToSpeech => new TextToSpeechClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// + /// + public TokenizerClient Tokenizer => new TokenizerClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// Feedback submission and CLI version. + /// + public UtilitiesClient Utilities => new UtilitiesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + + /// + /// + /// + public VideosClient Videos => new VideosClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContextProvider = JsonSerializerContextProvider, + }; + /// /// Creates a new instance of the DeepInfraClient. /// If no httpClient is provided, a new one will be created. @@ -49,11 +249,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..ef20ca3c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.OpenaiEmbeddings.g.cs @@ -0,0 +1,590 @@ + +#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, + ref string? xApiKey, + 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, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiEmbeddingsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiEmbeddingsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + userAgent: ref userAgent, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareOpenaiEmbeddingsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + 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: "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. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// model name + /// + /// + /// text or multimodal content to embed. Each item is either a string, or a list of content parts ({"type":"text"} / {"type":"image_url"}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2. + /// + /// + /// Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models. + /// + /// + /// 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>>> input, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::DeepInfra.OpenAIEmbeddingsInInputType2? inputType = 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, + FailFast = failFast, + Model = model, + Input = input, + InputType = inputType, + EncodingFormat = encodingFormat, + Dimensions = dimensions, + }; + + return await OpenaiEmbeddingsAsync( + xDeepinfraSource: xDeepinfraSource, + userAgent: userAgent, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..0b58a0ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.CancelOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CancelOpenaiBatch.g.cs new file mode 100644 index 00000000..8fb3c412 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CancelOpenaiBatch.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CancelOpenaiBatchSecurityRequirement0 = + 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_CancelOpenaiBatchSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CancelOpenaiBatchSecurityRequirement0, + }; + partial void PrepareCancelOpenaiBatchArguments( + global::System.Net.Http.HttpClient httpClient, + ref string batchId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareCancelOpenaiBatchRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId, + string? xiApiKey, + string? xApiKey); + partial void ProcessCancelOpenaiBatchResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCancelOpenaiBatchResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Cancel 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 CancelOpenaiBatchAsync( + string batchId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelOpenaiBatchAsResponseAsync( + batchId: batchId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel 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> CancelOpenaiBatchAsResponseAsync( + string batchId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCancelOpenaiBatchArguments( + httpClient: HttpClient, + batchId: ref batchId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CancelOpenaiBatchSecurityRequirements, + operationName: "CancelOpenaiBatchAsync"); + + 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}/cancel", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCancelOpenaiBatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + batchId: batchId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "CancelOpenaiBatch", + methodName: "CancelOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}/cancel\"", + 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: "CancelOpenaiBatch", + methodName: "CancelOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}/cancel\"", + 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: "CancelOpenaiBatch", + methodName: "CancelOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}/cancel\"", + 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); + ProcessCancelOpenaiBatchResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CancelOpenaiBatch", + methodName: "CancelOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}/cancel\"", + 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: "CancelOpenaiBatch", + methodName: "CancelOpenaiBatchAsync", + pathTemplate: "$\"/v1/batches/{batchId}/cancel\"", + 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); + ProcessCancelOpenaiBatchResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIBatchesOut.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.OpenAIBatchesOut.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.FilesBatchesClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CreateOpenaiBatch.g.cs new file mode 100644 index 00000000..e4637024 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CreateOpenaiBatch.g.cs @@ -0,0 +1,550 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.OpenAIBatchesIn request); + partial void PrepareCreateOpenaiBatchRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateOpenaiBatchAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareCreateOpenaiBatchArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareCreateOpenaiBatchRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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.OpenAIBatchesOut.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.OpenAIBatchesOut.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, /v1/embeddings 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 expiration policy for the output and/or error file generated for 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? xApiKey = default, + string completionWindow = "24h", + global::System.Collections.Generic.Dictionary? metadata = default, + global::DeepInfra.BatchOutputExpiresAfter? outputExpiresAfter = 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, + OutputExpiresAfter = outputExpiresAfter, + }; + + return await CreateOpenaiBatchAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.DeleteFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.DeleteFile.g.cs new file mode 100644 index 00000000..26e2851c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.DeleteFile.g.cs @@ -0,0 +1,485 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteFileSecurityRequirement0 = + 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_DeleteFileSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteFileSecurityRequirement0, + }; + partial void PrepareDeleteFileArguments( + global::System.Net.Http.HttpClient httpClient, + ref string fileId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeleteFileRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string fileId, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeleteFileResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteFileResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteFileAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteFileAsResponseAsync( + fileId: fileId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteFileAsResponseAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteFileArguments( + httpClient: HttpClient, + fileId: ref fileId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteFileSecurityRequirements, + operationName: "DeleteFileAsync"); + + 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/{fileId}", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeleteFile", + methodName: "DeleteFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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: "DeleteFile", + methodName: "DeleteFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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: "DeleteFile", + methodName: "DeleteFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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); + ProcessDeleteFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteFile", + methodName: "DeleteFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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: "DeleteFile", + methodName: "DeleteFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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); + ProcessDeleteFileResponseContent( + 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.GetFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.GetFile.g.cs new file mode 100644 index 00000000..0b0313fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.GetFile.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetFileSecurityRequirement0 = + 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_GetFileSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetFileSecurityRequirement0, + }; + partial void PrepareGetFileArguments( + global::System.Net.Http.HttpClient httpClient, + ref string fileId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetFileRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string fileId, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetFileResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetFileResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetFileAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFileAsResponseAsync( + fileId: fileId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetFileAsResponseAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetFileArguments( + httpClient: HttpClient, + fileId: ref fileId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetFileSecurityRequirements, + operationName: "GetFileAsync"); + + 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/{fileId}", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetFile", + methodName: "GetFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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: "GetFile", + methodName: "GetFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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: "GetFile", + methodName: "GetFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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); + ProcessGetFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFile", + methodName: "GetFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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: "GetFile", + methodName: "GetFileAsync", + pathTemplate: "$\"/v1/files/{fileId}\"", + 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); + ProcessGetFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenAIFile.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.OpenAIFile.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.FilesBatchesClient.GetFileContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.GetFileContent.g.cs new file mode 100644 index 00000000..f58d5460 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.GetFileContent.g.cs @@ -0,0 +1,485 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class FilesBatchesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetFileContentSecurityRequirement0 = + 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_GetFileContentSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetFileContentSecurityRequirement0, + }; + partial void PrepareGetFileContentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string fileId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetFileContentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string fileId, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetFileContentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetFileContentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get File 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 GetFileContentAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFileContentAsResponseAsync( + fileId: fileId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get File 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> GetFileContentAsResponseAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetFileContentArguments( + httpClient: HttpClient, + fileId: ref fileId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetFileContentSecurityRequirements, + operationName: "GetFileContentAsync"); + + 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/{fileId}/content", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetFileContentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetFileContent", + methodName: "GetFileContentAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + 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: "GetFileContent", + methodName: "GetFileContentAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + 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: "GetFileContent", + methodName: "GetFileContentAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + 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); + ProcessGetFileContentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetFileContent", + methodName: "GetFileContentAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + 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: "GetFileContent", + methodName: "GetFileContentAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + 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); + ProcessGetFileContentResponseContent( + 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.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.ListFiles.g.cs new file mode 100644 index 00000000..fc0c5462 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.ListFiles.g.cs @@ -0,0 +1,522 @@ + +#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, + ref string? xApiKey); + 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, + string? xApiKey); + 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: 10000 + /// + /// + /// + /// Per-request overrides 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, + string? xApiKey = 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, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 10000 + /// + /// + /// + /// Per-request overrides 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..816810eb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.OpenaiFiles.g.cs @@ -0,0 +1,1494 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyOpenaiFilesV1FilesPost request); + partial void PrepareOpenaiFilesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiFilesAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiFilesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __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, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __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, + 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: "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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __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, + 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: "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..294681b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatch.g.cs @@ -0,0 +1,489 @@ + +#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, + ref string? xApiKey); + partial void PrepareRetrieveOpenaiBatchRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string batchId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveOpenaiBatchAsResponseAsync( + batchId: batchId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareRetrieveOpenaiBatchArguments( + httpClient: HttpClient, + batchId: ref batchId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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(); + + var __value = global::DeepInfra.OpenAIBatchesOut.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.OpenAIBatchesOut.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.FilesBatchesClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatches.g.cs new file mode 100644 index 00000000..7b366c87 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.RetrieveOpenaiBatches.g.cs @@ -0,0 +1,502 @@ + +#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, + ref string? xApiKey); + partial void PrepareRetrieveOpenaiBatchesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? after, + int? limit, + string? xiApiKey, + string? xApiKey); + 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 = default, + int? limit = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveOpenaiBatchesAsResponseAsync( + after: after, + limit: limit, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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 = default, + int? limit = default, + string? xiApiKey = default, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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 + .AddOptionalParameter("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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..b56f691a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..b03213c6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsDelete.g.cs @@ -0,0 +1,559 @@ + +#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, + ref string? xApiKey); + partial void PrepareContainerRentalsDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string containerId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsDeleteAsResponseAsync( + containerId: containerId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsDeleteArguments( + httpClient: HttpClient, + containerId: ref containerId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..e6d5464f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGet.g.cs @@ -0,0 +1,563 @@ + +#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, + ref string? xApiKey); + partial void PrepareContainerRentalsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string containerId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsGetAsResponseAsync( + containerId: containerId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsGetArguments( + httpClient: HttpClient, + containerId: ref containerId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..fd4a7feb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsGetParams.g.cs @@ -0,0 +1,513 @@ + +#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, + ref string? xApiKey); + partial void PrepareContainerRentalsGetParamsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsGetParamsAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsGetParamsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..3fd6b7e4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsList.g.cs @@ -0,0 +1,572 @@ + +#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, + ref string? xApiKey); + partial void PrepareContainerRentalsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsListAsResponseAsync( + state: state, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareContainerRentalsListArguments( + httpClient: HttpClient, + state: ref state, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..5f9b1b7b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsStart.g.cs @@ -0,0 +1,693 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ContainerRentalStartIn request); + partial void PrepareContainerRentalsStartRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsStartAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareContainerRentalsStartArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareContainerRentalsStartRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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)); + } + // 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)); + } + // 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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..23fb42b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsUpdate.g.cs @@ -0,0 +1,612 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ContainerRentalUpdateIn request); + partial void PrepareContainerRentalsUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string containerId, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ContainerRentalsUpdateAsResponseAsync( + containerId: containerId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareContainerRentalsUpdateArguments( + httpClient: HttpClient, + containerId: ref containerId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareContainerRentalsUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + containerId: containerId!, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..4c1ab5b6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.RentGpuAvailability.g.cs @@ -0,0 +1,502 @@ + +#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, + ref string? xApiKey); + partial void PrepareRentGpuAvailabilityRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? source, + string? baseModel, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RentGpuAvailabilityAsResponseAsync( + source: source, + baseModel: baseModel, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..855d239e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..5d93e61d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountEmailValues.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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.AccountGpuPool.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuPool.g.cs new file mode 100644 index 00000000..6c26c71b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuPool.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Account Gpu Pool + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AccountGpuPoolAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Gpu Pool + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AccountGpuPoolAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = 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..0cfa73e9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountRateLimit.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..50e8330b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountUpdateDetails.g.cs @@ -0,0 +1,105 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..cd427363 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.DeleteAccount.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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.GpuPoolGpuTypes.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.GpuPoolGpuTypes.g.cs new file mode 100644 index 00000000..3424faca --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.GpuPoolGpuTypes.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Gpu Pool Gpu Types + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GpuPoolGpuTypesAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Gpu Pool Gpu Types + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GpuPoolGpuTypesAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = 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..8892668b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.Me.g.cs @@ -0,0 +1,42 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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.RequestGpuPoolChange.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuPoolChange.g.cs new file mode 100644 index 00000000..7f3f7218 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuPoolChange.g.cs @@ -0,0 +1,59 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Request Gpu Pool Change + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RequestGpuPoolChangeAsync( + + global::DeepInfra.GpuPoolRequestIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Gpu Pool Change + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RequestGpuPoolChangeAsResponseAsync( + + global::DeepInfra.GpuPoolRequestIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Gpu Pool Change + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RequestGpuPoolChangeAsync( + string reason, + string? xiApiKey = default, + string? xApiKey = default, + global::System.Collections.Generic.Dictionary? requestedMin = default, + global::System.Collections.Generic.Dictionary? requestedMax = 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..e813ffc8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestRateLimitIncrease.g.cs @@ -0,0 +1,59 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..08529499 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.TeamSetDisplayName.g.cs @@ -0,0 +1,57 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..a1306f8f --- /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.CreateBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.CreateBackup.g.cs new file mode 100644 index 00000000..6c4da83b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.CreateBackup.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Create 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 CreateBackupAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create 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> CreateBackupAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.CreateDashboardLaunchToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.CreateDashboardLaunchToken.g.cs new file mode 100644 index 00000000..9736dd07 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.CreateDashboardLaunchToken.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Create Dashboard 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 CreateDashboardLaunchTokenAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Dashboard 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> CreateDashboardLaunchTokenAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.CreateInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.CreateInstance.g.cs new file mode 100644 index 00000000..db0d0566 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.CreateInstance.g.cs @@ -0,0 +1,67 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Create Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateInstanceAsync( + + global::DeepInfra.AgentCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateInstanceAsResponseAsync( + + global::DeepInfra.AgentCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Instance + /// + /// + /// + /// + /// 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 CreateInstanceAsync( + string name, + string? xiApiKey = default, + string? xApiKey = 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.DeleteInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.DeleteInstance.g.cs new file mode 100644 index 00000000..8034bece --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.DeleteInstance.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Delete Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.GetCatalog.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.GetCatalog.g.cs new file mode 100644 index 00000000..c703c326 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.GetCatalog.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Get 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> GetCatalogAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get 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>> GetCatalogAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = 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.GetInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.GetInstance.g.cs new file mode 100644 index 00000000..fdfe7929 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.GetInstance.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Get Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.ListBackups.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.ListBackups.g.cs new file mode 100644 index 00000000..2b2ebb3d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.ListBackups.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// 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> ListBackupsAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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>> ListBackupsAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.ListInstances.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.ListInstances.g.cs new file mode 100644 index 00000000..b2409ebe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.ListInstances.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// List Instances + /// + /// + /// 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> ListInstancesAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Instances + /// + /// + /// 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>> ListInstancesAsResponseAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = 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.RenameInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.RenameInstance.g.cs new file mode 100644 index 00000000..52bc1b59 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.RenameInstance.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Rename Instance + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RenameInstanceAsync( + string instanceId, + + global::DeepInfra.AgentUpdateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rename Instance + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RenameInstanceAsResponseAsync( + string instanceId, + + global::DeepInfra.AgentUpdateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Rename Instance + /// + /// + /// + /// + /// + /// 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 RenameInstanceAsync( + string instanceId, + string name, + string? xiApiKey = default, + string? xApiKey = 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.RestoreBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.RestoreBackup.g.cs new file mode 100644 index 00000000..a48d20c7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.RestoreBackup.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// 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 RestoreBackupAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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> RestoreBackupAsResponseAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = 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.StartInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.StartInstance.g.cs new file mode 100644 index 00000000..f65d8c87 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.StartInstance.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Start Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task StartInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Start Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StartInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.StopInstance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.StopInstance.g.cs new file mode 100644 index 00000000..2f7b59da --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.StopInstance.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Stop Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task StopInstanceAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Stop Instance + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StopInstanceAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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.UpdateInstanceVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.UpdateInstanceVersion.g.cs new file mode 100644 index 00000000..1bdcd5a6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.UpdateInstanceVersion.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Update Instance 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 UpdateInstanceVersionAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Instance 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> UpdateInstanceVersionAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = 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..4d612f8f --- /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..055bcd31 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs @@ -0,0 +1,94 @@ +#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, + string? xApiKey = 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Audio Speech + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// 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, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = 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..f1fb08c8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs @@ -0,0 +1,160 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + string? serviceTier = 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? xApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + string? serviceTier = 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? xApiKey = default, + string? language = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, + double? temperature = default, + global::System.Collections.Generic.IList? timestampGranularities = default, + string? serviceTier = 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..950709b2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranslations.g.cs @@ -0,0 +1,148 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + string? serviceTier = 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? xApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + string? serviceTier = 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? xApiKey = default, + string? prompt = default, + global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, + double? temperature = default, + string? serviceTier = 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..d5f24cd7 --- /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..42f04462 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateApiToken.g.cs @@ -0,0 +1,55 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..8b456aed --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateScopedJwt.g.cs @@ -0,0 +1,71 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..f595167e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateSshKey.g.cs @@ -0,0 +1,61 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..ddab5bad --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteApiToken.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..b7ec35cc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.DeleteSshKey.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..aac637f2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.ExportApiTokenToVercel.g.cs @@ -0,0 +1,69 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..f1f56a6e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiToken.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..28ee2b6a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetApiTokens.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..31c99253 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GetSshKeys.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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.GoogleLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GoogleLogin.g.cs new file mode 100644 index 00000000..b9691891 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.GoogleLogin.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAuthenticationClient + { + /// + /// Google Login
+ /// Initiate Google SSO login flow. Callback is /google/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 GoogleLoginAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Google Login
+ /// Initiate Google SSO login flow. Callback is /google/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> GoogleLoginAsResponseAsync( + 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..f074678d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.InspectScopedJwt.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..6ddcdfca --- /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..63032a42 --- /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..9cf18104 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs @@ -0,0 +1,122 @@ +#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? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xDeepinfraServiceTier = default, + string? xiApiKey = default, + string? xApiKey = 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? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xDeepinfraServiceTier = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + /// + /// + /// + /// + /// + /// + /// 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? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xDeepinfraServiceTier = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::System.Collections.Generic.IList? models = 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, + string? promptCacheKey = 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..b1f98dd2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessagesCountTokens.g.cs @@ -0,0 +1,65 @@ +#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? xiApiKey = default, + 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? xiApiKey = default, + 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? xiApiKey = default, + 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..aa509498 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.OpenaiChatCompletions.g.cs @@ -0,0 +1,194 @@ +#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, + string? xApiKey = 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Chat Completions + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + /// + /// 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 65536, 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, minimal, low, medium, high, xhigh, and max. 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. + /// + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + /// + /// 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. + /// + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// + /// Per-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, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::System.Collections.Generic.IList? models = 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, + global::DeepInfra.PromptCacheOptions? promptCacheOptions = default, + object? chatTemplateKwargs = default, + bool? continueFinalMessage = default, + bool? ignoreEos = 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..834c9546 --- /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.DeployArgsHistory.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployArgsHistory.g.cs new file mode 100644 index 00000000..c8d0b9a3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployArgsHistory.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Args History + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeployArgsHistoryAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Args History + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> DeployArgsHistoryAsResponseAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = 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.DeployArgsRestore.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployArgsRestore.g.cs new file mode 100644 index 00000000..bc43b38d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployArgsRestore.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Args Restore + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeployArgsRestoreAsync( + string deployId, + string entryId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Args Restore + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeployArgsRestoreAsResponseAsync( + string deployId, + string entryId, + string? xiApiKey = default, + string? xApiKey = 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.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs new file mode 100644 index 00000000..eaff88b9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs @@ -0,0 +1,66 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..bfb68974 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateHf.g.cs @@ -0,0 +1,61 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..ea15a672 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateLlm.g.cs @@ -0,0 +1,90 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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 + /// + /// + /// + /// Base public model + /// + /// + /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) + /// + /// + /// + /// Extra command line arguments for custom deployments + /// + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. Unset knobs use the model/engine defaults. + /// + /// + /// Apply a stored preset or vLLM recipe by id. A non-empty standard_args or extra_args in this request replaces the preset's whole matching field. + /// + /// Per-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, + string? xApiKey = default, + int? numGpus = 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.StandardArgs? standardArgs = default, + string? presetId = 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..5b9def3d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDelete.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..cc71663c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployDetailedStats.g.cs @@ -0,0 +1,56 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..847af69d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployGpuAvailability.g.cs @@ -0,0 +1,42 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..6de0b854 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployList2.g.cs @@ -0,0 +1,42 @@ +#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,updating,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, + string? xApiKey = 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,updating,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, + string? xApiKey = 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.DeployLlmPresets.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmPresets.g.cs new file mode 100644 index 00000000..e7180a54 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmPresets.g.cs @@ -0,0 +1,54 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Llm Presets
+ /// DeepInfra presets and mirrored vLLM recipes for ``hf_repo_id``, told apart by
+ /// ``source``; empty when none. Filter by ``gpu``/``engine``/``source``. + ///
+ /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeployLlmPresetsAsync( + string hfRepoId, + global::DeepInfra.DeployGPUs? gpu = default, + string? engine = default, + string? source = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Llm Presets
+ /// DeepInfra presets and mirrored vLLM recipes for ``hf_repo_id``, told apart by
+ /// ``source``; empty when none. Filter by ``gpu``/``engine``/``source``. + ///
+ /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> DeployLlmPresetsAsResponseAsync( + string hfRepoId, + global::DeepInfra.DeployGPUs? gpu = default, + string? engine = default, + string? source = default, + string? xiApiKey = default, + string? xApiKey = 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.DeployLlmStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmStandardArgs.g.cs new file mode 100644 index 00000000..992af2ac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmStandardArgs.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Llm Standard Args + /// + /// + /// Default Value: vllm + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeployLlmStandardArgsAsync( + string? engine = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Llm Standard Args + /// + /// + /// Default Value: vllm + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeployLlmStandardArgsAsResponseAsync( + string? engine = default, + string? xiApiKey = default, + string? xApiKey = 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..9584e4a5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmSuggestName.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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.DeployRebalance.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployRebalance.g.cs new file mode 100644 index 00000000..06c956f3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployRebalance.g.cs @@ -0,0 +1,81 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Rebalance
+ /// Start a GPU pool rebalance: move GPUs from this deployment onto another
+ /// deployment you own, one instance at a time and without downtime. Moving all
+ /// instances stops this deployment; start it again later to resume 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 DeployRebalanceAsync( + string deployId, + + global::DeepInfra.RebalanceIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Rebalance
+ /// Start a GPU pool rebalance: move GPUs from this deployment onto another
+ /// deployment you own, one instance at a time and without downtime. Moving all
+ /// instances stops this deployment; start it again later to resume 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> DeployRebalanceAsResponseAsync( + string deployId, + + global::DeepInfra.RebalanceIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Rebalance
+ /// Start a GPU pool rebalance: move GPUs from this deployment onto another
+ /// deployment you own, one instance at a time and without downtime. Moving all
+ /// instances stops this deployment; start it again later to resume it. + ///
+ /// + /// + /// + /// + /// Deployment to grow using GPUs freed from this one. + /// + /// + /// Number of target instances to create. + /// + /// + /// Validate and preview without moving anything.
+ /// 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 DeployRebalanceAsync( + string deployId, + string targetDeployId, + int count, + string? xiApiKey = default, + string? xApiKey = default, + bool? dryRun = 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.DeployRebalanceCancel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployRebalanceCancel.g.cs new file mode 100644 index 00000000..641e4b31 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployRebalanceCancel.g.cs @@ -0,0 +1,65 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Rebalance Cancel
+ /// Stop an in-flight GPU pool rebalance; instances already moved stay, and
+ /// both deployments keep min/max instances fixed at their current counts. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeployRebalanceCancelAsync( + string deployId, + + global::DeepInfra.RebalanceCancelIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Rebalance Cancel
+ /// Stop an in-flight GPU pool rebalance; instances already moved stay, and
+ /// both deployments keep min/max instances fixed at their current counts. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeployRebalanceCancelAsResponseAsync( + string deployId, + + global::DeepInfra.RebalanceCancelIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Rebalance Cancel
+ /// Stop an in-flight GPU pool rebalance; instances already moved stay, and
+ /// both deployments keep min/max instances fixed at their current counts. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeployRebalanceCancelAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = 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.DeployRebalanceStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployRebalanceStatus.g.cs new file mode 100644 index 00000000..44b5a409 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployRebalanceStatus.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Rebalance Status
+ /// Status of GPU pool rebalances touching this deployment. A just-started
+ /// rebalance can take a moment to appear. A finished or cancelled rebalance
+ /// leaves both deployments' min/max instances fixed at the final counts; edit
+ /// them to resume autoscaling. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeployRebalanceStatusAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Rebalance Status
+ /// Status of GPU pool rebalances touching this deployment. A just-started
+ /// rebalance can take a moment to appear. A finished or cancelled rebalance
+ /// leaves both deployments' min/max instances fixed at the final counts; edit
+ /// them to resume autoscaling. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeployRebalanceStatusAsResponseAsync( + string deployId, + string? xiApiKey = default, + string? xApiKey = 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..1e6e7835 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStart.g.cs @@ -0,0 +1,40 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..7fc34862 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStats.g.cs @@ -0,0 +1,56 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..a88e0ce2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStatus.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..e3cd0e05 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployStop.g.cs @@ -0,0 +1,40 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..86c25bc6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployUpdate.g.cs @@ -0,0 +1,69 @@ +#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, + string? xApiKey = 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Update + /// + /// + /// + /// + /// + /// + /// Engine tuning knobs. Replaces the whole set; omitted knobs are cleared. + /// + /// + /// Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared. + /// + /// Per-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, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ScaleSettings? settings = default, + global::DeepInfra.StandardArgs? standardArgs = 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.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeploymentStats.g.cs new file mode 100644 index 00000000..2cc44c76 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeploymentStats.g.cs @@ -0,0 +1,52 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..36eaf259 --- /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..6e9afbcb 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,12 +33,122 @@ 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; } + /// - /// + /// /// 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; } + + /// + /// Create and manage isolated sandbox environments. + /// + public SandboxesClient Sandboxes { get; } + + /// + /// OpenAI-compatible text completion endpoints. + /// + public TextCompletionsClient TextCompletions { get; } + + /// + /// ElevenLabs-compatible TTS endpoints and voice management. + /// + public TextToSpeechClient TextToSpeech { get; } + + /// + /// + /// + public TokenizerClient Tokenizer { get; } + + /// + /// Feedback submission and CLI version. + /// + public UtilitiesClient Utilities { get; } + + /// + /// + /// + public VideosClient Videos { 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..ae7f81ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.OpenaiEmbeddings.g.cs @@ -0,0 +1,95 @@ +#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, + string? xApiKey = 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Embeddings + /// + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// model name + /// + /// + /// text or multimodal content to embed. Each item is either a string, or a list of content parts ({"type":"text"} / {"type":"image_url"}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2. + /// + /// + /// Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models. + /// + /// + /// 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>>> input, + string? xDeepinfraSource = default, + string? userAgent = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::DeepInfra.OpenAIEmbeddingsInInputType2? inputType = 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..32e51051 --- /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.CancelOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CancelOpenaiBatch.g.cs new file mode 100644 index 00000000..ff92b380 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CancelOpenaiBatch.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Cancel 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 CancelOpenaiBatchAsync( + string batchId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel 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> CancelOpenaiBatchAsResponseAsync( + string batchId, + string? xiApiKey = default, + string? xApiKey = 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.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CreateOpenaiBatch.g.cs new file mode 100644 index 00000000..50f74929 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.CreateOpenaiBatch.g.cs @@ -0,0 +1,73 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, /v1/embeddings 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 expiration policy for the output and/or error file generated for 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? xApiKey = default, + string completionWindow = "24h", + global::System.Collections.Generic.Dictionary? metadata = default, + global::DeepInfra.BatchOutputExpiresAfter? outputExpiresAfter = 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.DeleteFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.DeleteFile.g.cs new file mode 100644 index 00000000..ef90c535 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.DeleteFile.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Delete File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteFileAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteFileAsResponseAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = 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.GetFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.GetFile.g.cs new file mode 100644 index 00000000..9b89c5b9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.GetFile.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Get File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetFileAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetFileAsResponseAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = 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.GetFileContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.GetFileContent.g.cs new file mode 100644 index 00000000..39106b86 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.GetFileContent.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// Get File 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 GetFileContentAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get File 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> GetFileContentAsResponseAsync( + string fileId, + string? xiApiKey = default, + string? xApiKey = 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..563496cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.ListFiles.g.cs @@ -0,0 +1,54 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IFilesBatchesClient + { + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 10000 + /// + /// + /// + /// Per-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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 10000 + /// + /// + /// + /// Per-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, + string? xApiKey = 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..38fb5788 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.OpenaiFiles.g.cs @@ -0,0 +1,104 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..2ea63526 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatch.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..96730380 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.RetrieveOpenaiBatches.g.cs @@ -0,0 +1,46 @@ +#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 = default, + int? limit = default, + string? xiApiKey = default, + string? xApiKey = 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 = default, + int? limit = default, + string? xiApiKey = default, + string? xApiKey = 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..f0b4e4de --- /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..a3c5d580 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsDelete.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..94706a1d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGet.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..468acaf8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsGetParams.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..fde468df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsList.g.cs @@ -0,0 +1,44 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..1fad9cf2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsStart.g.cs @@ -0,0 +1,69 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..67bfeea5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsUpdate.g.cs @@ -0,0 +1,63 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..98b685cd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.RentGpuAvailability.g.cs @@ -0,0 +1,42 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..a1b8620f --- /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..2b355d7e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesEdits.g.cs @@ -0,0 +1,119 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..5561f031 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesGenerations.g.cs @@ -0,0 +1,91 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..474f0cad --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesVariations.g.cs @@ -0,0 +1,113 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..68e1ed3e --- /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..c01843ff --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceDeploy.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..dd86bcde --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceModel.g.cs @@ -0,0 +1,46 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..5eee3bd7 --- /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..5539958b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.CreateLora.g.cs @@ -0,0 +1,63 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..36fd3d06 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLora.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..d187b216 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.DeleteLoraModel.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..0369fa72 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLora.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..cd0c2ab9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetLoraStatus.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..9d64e16c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetModelLoras.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..228185ad --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.GetUserLoras.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..e4268f37 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UpdateLora.g.cs @@ -0,0 +1,63 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..fc9d15f7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.UploadLoraModel.g.cs @@ -0,0 +1,61 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..5a5f8dfd --- /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..0e1a1fa5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.DeploymentLogsQuery.g.cs @@ -0,0 +1,88 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..cca6b713 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.GetRequestCosts.g.cs @@ -0,0 +1,55 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..3aba8549 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.LogsQuery.g.cs @@ -0,0 +1,80 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..ff04e026 --- /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..3464ca5f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.GetHardware.g.cs @@ -0,0 +1,42 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..ad5317b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelDelete.g.cs @@ -0,0 +1,46 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..4d2c280e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelMetaUpdate.g.cs @@ -0,0 +1,91 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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) + /// + /// + /// dataurl or regular url to a sample of this model's output, shown on the model page before the first run (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? xApiKey = default, + string? description = default, + string? githubUrl = default, + string? paperUrl = default, + string? licenseUrl = default, + string? readme = default, + string? coverImgUrl = default, + string? sampleOutputUrl = 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..65e6620d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelPublicity.g.cs @@ -0,0 +1,63 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..1ca88e08 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelSchema.g.cs @@ -0,0 +1,46 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..6f172462 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelVersions.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..0b48eebc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsDeploymentList.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..78a6f012 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelsInfo.g.cs @@ -0,0 +1,42 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..67910684 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.OpenaiModels.g.cs @@ -0,0 +1,42 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..dbc3f5ff --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.PrivateModelsList.g.cs @@ -0,0 +1,34 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..d9df76fd --- /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.ISandboxesClient.CreateSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.CreateSandbox.g.cs new file mode 100644 index 00000000..7b0f41a2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.CreateSandbox.g.cs @@ -0,0 +1,64 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Create Sandbox
+ /// Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateSandboxAsync( + + global::DeepInfra.SandboxCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Sandbox
+ /// Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateSandboxAsResponseAsync( + + global::DeepInfra.SandboxCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Sandbox
+ /// Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously. + ///
+ /// + /// + /// + /// + /// + /// 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 CreateSandboxAsync( + string? xiApiKey = default, + string? xApiKey = default, + string? plan = default, + global::System.Collections.Generic.Dictionary? tags = default, + int? timeoutSeconds = 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.ISandboxesClient.DeleteSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.DeleteSandbox.g.cs new file mode 100644 index 00000000..c1428188 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.DeleteSandbox.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Delete Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.ExecCommand.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ExecCommand.g.cs new file mode 100644 index 00000000..f52ae559 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ExecCommand.g.cs @@ -0,0 +1,69 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Exec Command
+ /// Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ExecCommandAsync( + string sandboxId, + + global::DeepInfra.SandboxExecIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Exec Command
+ /// Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ExecCommandAsResponseAsync( + string sandboxId, + + global::DeepInfra.SandboxExecIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Exec Command
+ /// Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line. + ///
+ /// + /// + /// + /// + /// + /// Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).
+ /// 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 ExecCommandAsync( + string sandboxId, + global::System.Collections.Generic.IList command, + string? xiApiKey = default, + string? xApiKey = default, + int? timeoutSeconds = 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.ISandboxesClient.GetSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.GetSandbox.g.cs new file mode 100644 index 00000000..ea6f9e74 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.GetSandbox.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Get Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.ListSandboxPlans.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ListSandboxPlans.g.cs new file mode 100644 index 00000000..9ded5461 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ListSandboxPlans.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// List Sandbox Plans
+ /// Returns all available sandbox plans with their resource specs and pricing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListSandboxPlansAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Sandbox Plans
+ /// Returns all available sandbox plans with their resource specs and pricing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListSandboxPlansAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.ListSandboxes.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ListSandboxes.g.cs new file mode 100644 index 00000000..3cc3f35e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ListSandboxes.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// List Sandboxes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListSandboxesAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Sandboxes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ListSandboxesAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.ReadFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ReadFile.g.cs new file mode 100644 index 00000000..75d0c895 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.ReadFile.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Read File
+ /// Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-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 ReadFileAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Read File
+ /// Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-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> ReadFileAsResponseAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.StartSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.StartSandbox.g.cs new file mode 100644 index 00000000..74e507d2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.StartSandbox.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Start Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task StartSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Start Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StartSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.StopSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.StopSandbox.g.cs new file mode 100644 index 00000000..126294b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.StopSandbox.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Stop Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task StopSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Stop Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StopSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.WriteFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.WriteFile.g.cs new file mode 100644 index 00000000..d50025d4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.WriteFile.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ISandboxesClient + { + /// + /// Write File
+ /// Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task WriteFileAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Write File
+ /// Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> WriteFileAsResponseAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = 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.ISandboxesClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.g.cs new file mode 100644 index 00000000..95fb2805 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ISandboxesClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Create and manage isolated sandbox environments.
+ /// 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 ISandboxesClient : 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..5a6c1452 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs @@ -0,0 +1,182 @@ +#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, + string? xApiKey = 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openai Completions + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + /// + /// 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 65536, 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. + /// + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + /// + /// 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,...'). + /// + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// + /// Per-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, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::System.Collections.Generic.IList? models = 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.PromptCacheOptions? promptCacheOptions = default, + global::DeepInfra.CompletionMultiModalData? data = default, + bool? ignoreEos = 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..3053330a --- /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..ef10063e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.CreateVoice.g.cs @@ -0,0 +1,115 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..458b506c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.DeleteVoice.g.cs @@ -0,0 +1,38 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..b14c4a1b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoice.g.cs @@ -0,0 +1,40 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..4d9dd51c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.GetVoices.g.cs @@ -0,0 +1,36 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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..2eeedae8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeech.g.cs @@ -0,0 +1,83 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..44dafa8e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.TextToSpeechStream.g.cs @@ -0,0 +1,83 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..b7017d8b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.UpdateVoice.g.cs @@ -0,0 +1,63 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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, + string? xApiKey = 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..41dd726e --- /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.ITokenizerClient.Detokenize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITokenizerClient.Detokenize.g.cs new file mode 100644 index 00000000..633fa314 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITokenizerClient.Detokenize.g.cs @@ -0,0 +1,61 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITokenizerClient + { + /// + /// Detokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DetokenizeAsync( + + global::DeepInfra.DetokenizeIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DetokenizeAsResponseAsync( + + global::DeepInfra.DetokenizeIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Detokenize + /// + /// + /// + /// + /// model name + /// + /// + /// token ids to detokenize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DetokenizeAsync( + string model, + string? xiApiKey = default, + string? xApiKey = default, + global::System.Collections.Generic.IList? tokens = 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.ITokenizerClient.Tokenize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITokenizerClient.Tokenize.g.cs new file mode 100644 index 00000000..ee1afd3d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITokenizerClient.Tokenize.g.cs @@ -0,0 +1,69 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface ITokenizerClient + { + /// + /// Tokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TokenizeAsync( + + global::DeepInfra.TokenizeIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Tokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> TokenizeAsResponseAsync( + + global::DeepInfra.TokenizeIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Tokenize + /// + /// + /// + /// + /// model name + /// + /// + /// text to tokenize (completion form) + /// + /// + /// chat messages to tokenize (chat form) + /// + /// + /// also return the per-token strings (vLLM) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TokenizeAsync( + string model, + string? xiApiKey = default, + string? xApiKey = default, + string? prompt = default, + global::System.Collections.Generic.IList? messages = default, + bool? returnTokenStrs = 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.ITokenizerClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITokenizerClient.g.cs new file mode 100644 index 00000000..7ddf27a6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITokenizerClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// 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 ITokenizerClient : 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..17bf6bb4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.SubmitFeedback.g.cs @@ -0,0 +1,64 @@ +#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, + string? xApiKey = 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, + string? xApiKey = 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? xApiKey = 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..65d56648 --- /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.IVideosClient.CreateVideoGeneration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration.g.cs new file mode 100644 index 00000000..ecca1e65 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration.g.cs @@ -0,0 +1,73 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IVideosClient + { + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateVideoGenerationAsync( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateVideoGenerationAsResponseAsync( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Video Generation + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateVideoGenerationAsync( + string model, + string prompt, + string? xiApiKey = default, + string? xApiKey = default, + string? negativePrompt = default, + string? aspectRatio = default, + string? size = default, + int? seconds = default, + int? seed = default, + string? style = default, + string? imageUrl = 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.IVideosClient.CreateVideoGeneration2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration2.g.cs new file mode 100644 index 00000000..c9598f48 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration2.g.cs @@ -0,0 +1,73 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IVideosClient + { + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateVideoGeneration2Async( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateVideoGeneration2AsResponseAsync( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Video Generation + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateVideoGeneration2Async( + string model, + string prompt, + string? xiApiKey = default, + string? xApiKey = default, + string? negativePrompt = default, + string? aspectRatio = default, + string? size = default, + int? seconds = default, + int? seed = default, + string? style = default, + string? imageUrl = 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.IVideosClient.GetVideoContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoContent.g.cs new file mode 100644 index 00000000..6f9e3cd8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoContent.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IVideosClient + { + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetVideoContentAsync( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVideoContentAsResponseAsync( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = 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.IVideosClient.GetVideoContent2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoContent2.g.cs new file mode 100644 index 00000000..1347ceaa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoContent2.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IVideosClient + { + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetVideoContent2Async( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVideoContent2AsResponseAsync( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = 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.IVideosClient.GetVideoGeneration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoGeneration.g.cs new file mode 100644 index 00000000..3607486f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoGeneration.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IVideosClient + { + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetVideoGenerationAsync( + string videoId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVideoGenerationAsResponseAsync( + string videoId, + string? xiApiKey = default, + string? xApiKey = 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.IVideosClient.GetVideoGeneration2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoGeneration2.g.cs new file mode 100644 index 00000000..8d292914 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.GetVideoGeneration2.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IVideosClient + { + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetVideoGeneration2Async( + string videoId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetVideoGeneration2AsResponseAsync( + string videoId, + string? xiApiKey = default, + string? xApiKey = 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.IVideosClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.g.cs new file mode 100644 index 00000000..1abf1757 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// 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 IVideosClient : 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..2c82273c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesEdits.g.cs @@ -0,0 +1,1574 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); + partial void PrepareOpenaiImagesEditsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiImagesEditsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiImagesEditsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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, + 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: "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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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, + 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: "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..2e1066a7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesGenerations.g.cs @@ -0,0 +1,571 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.OpenAIImagesGenerationsIn request); + partial void PrepareOpenaiImagesGenerationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiImagesGenerationsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiImagesGenerationsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareOpenaiImagesGenerationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..a080ceb2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesVariations.g.cs @@ -0,0 +1,1553 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); + partial void PrepareOpenaiImagesVariationsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiImagesVariationsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiImagesVariationsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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, + 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: "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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + 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, + 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: "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..2bf848dc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..d50da406 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceDeploy.g.cs @@ -0,0 +1,559 @@ + +#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, + ref string? xApiKey); + partial void PrepareInferenceDeployRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string deployId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InferenceDeployAsResponseAsync( + deployId: deployId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareInferenceDeployArguments( + httpClient: HttpClient, + deployId: ref deployId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..a19b9670 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceModel.g.cs @@ -0,0 +1,612 @@ + +#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, + ref string? xApiKey); + partial void PrepareInferenceModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? version, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await InferenceModelAsResponseAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..cb497527 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..639d677f --- /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..0ec60111 --- /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.AnthropicThinkingConfigType2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnthropicThinkingConfigType2.g.cs new file mode 100644 index 00000000..0bfeea1c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnthropicThinkingConfigType2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class AnthropicThinkingConfigType2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.AnthropicThinkingConfigType2 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.AnthropicThinkingConfigType2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.AnthropicThinkingConfigType2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.AnthropicThinkingConfigType2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AnthropicThinkingConfigType2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.AnthropicThinkingConfigType2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnthropicThinkingConfigType2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnthropicThinkingConfigType2Nullable.g.cs new file mode 100644 index 00000000..6535cad5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnthropicThinkingConfigType2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class AnthropicThinkingConfigType2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.AnthropicThinkingConfigType2? 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.AnthropicThinkingConfigType2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.AnthropicThinkingConfigType2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.AnthropicThinkingConfigType2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AnthropicThinkingConfigType2? 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.AnthropicThinkingConfigType2Extensions.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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs index 3bb9b838..0e44ea5d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs @@ -20,7 +20,7 @@ public sealed class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostRespon { return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2Extensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2Nullable.g.cs index 0b07a729..0631b7fe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2Nullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2Nullable.g.cs @@ -20,7 +20,7 @@ public sealed class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostRespon { return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2Extensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs index 48ad58cd..c650cc98 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs @@ -20,7 +20,7 @@ public sealed class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimest { return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs index 44e1d78d..e30c4581 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs @@ -20,7 +20,7 @@ public sealed class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimest { return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs index 1aee1efe..930afd7d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs @@ -20,7 +20,7 @@ public sealed class BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFo { return global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2Extensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2Nullable.g.cs index 32e0e0b0..f51f3d10 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2Nullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2Nullable.g.cs @@ -20,7 +20,7 @@ public sealed class BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFo { return global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2Extensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: 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.ChatReasoningSettingsEffort2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2.g.cs index 708734ab..18c680d7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2.g.cs @@ -20,7 +20,7 @@ public sealed class ChatReasoningSettingsEffort2JsonConverter : global::System.T { return global::DeepInfra.ChatReasoningSettingsEffort2Extensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2Nullable.g.cs index 235d6897..ec3943d2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2Nullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort2Nullable.g.cs @@ -20,7 +20,7 @@ public sealed class ChatReasoningSettingsEffort2NullableJsonConverter : global:: { return global::DeepInfra.ChatReasoningSettingsEffort2Extensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOut.g.cs index 05bb4fd1..910220f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOut.g.cs @@ -20,7 +20,7 @@ public sealed class ContainerRentalStateOutJsonConverter : global::System.Text.J { return global::DeepInfra.ContainerRentalStateOutExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOutNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOutNullable.g.cs index f1476475..61587a10 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOutNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalStateOutNullable.g.cs @@ -20,7 +20,7 @@ public sealed class ContainerRentalStateOutNullableJsonConverter : global::Syste { return global::DeepInfra.ContainerRentalStateOutExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetState.g.cs index f2536080..7ab1eb3d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetState.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetState.g.cs @@ -20,7 +20,7 @@ public sealed class ContainerRentalsListV1ContainersGetStateJsonConverter : glob { return global::DeepInfra.ContainerRentalsListV1ContainersGetStateExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetStateNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetStateNullable.g.cs index 6ad14fba..75be0307 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetStateNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetStateNullable.g.cs @@ -20,7 +20,7 @@ public sealed class ContainerRentalsListV1ContainersGetStateNullableJsonConverte { return global::DeepInfra.ContainerRentalsListV1ContainersGetStateExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUs.g.cs index 1ce13de4..f3f8c55f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUs.g.cs @@ -20,7 +20,7 @@ public sealed class DeployGPUsJsonConverter : global::System.Text.Json.Serializa { return global::DeepInfra.DeployGPUsExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUsNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUsNullable.g.cs index 6d60d661..e2f46f4e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUsNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployGPUsNullable.g.cs @@ -20,7 +20,7 @@ public sealed class DeployGPUsNullableJsonConverter : global::System.Text.Json.S { return global::DeepInfra.DeployGPUsExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployType.g.cs index 3cc1afd1..b0a2db6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployType.g.cs @@ -20,7 +20,7 @@ public sealed class DeployTypeJsonConverter : global::System.Text.Json.Serializa { return global::DeepInfra.DeployTypeExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployTypeNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployTypeNullable.g.cs index bc795954..77075722 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployTypeNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeployTypeNullable.g.cs @@ -20,7 +20,7 @@ public sealed class DeployTypeNullableJsonConverter : global::System.Text.Json.S { return global::DeepInfra.DeployTypeExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..e223b648 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class DeploymentOutStandardArgsKvCacheDtype2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2 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.DeploymentOutStandardArgsKvCacheDtype2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2Nullable.g.cs new file mode 100644 index 00000000..36dd4edc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class DeploymentOutStandardArgsKvCacheDtype2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2? 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.DeploymentOutStandardArgsKvCacheDtype2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2? 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.DeploymentOutStandardArgsKvCacheDtype2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2.g.cs new file mode 100644 index 00000000..eb1846b5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class DeploymentOutStandardArgsQuantization2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.DeploymentOutStandardArgsQuantization2 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.DeploymentOutStandardArgsQuantization2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.DeploymentOutStandardArgsQuantization2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.DeploymentOutStandardArgsQuantization2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.DeploymentOutStandardArgsQuantization2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.DeploymentOutStandardArgsQuantization2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2Nullable.g.cs new file mode 100644 index 00000000..5d8ca167 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class DeploymentOutStandardArgsQuantization2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.DeploymentOutStandardArgsQuantization2? 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.DeploymentOutStandardArgsQuantization2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.DeploymentOutStandardArgsQuantization2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.DeploymentOutStandardArgsQuantization2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.DeploymentOutStandardArgsQuantization2? 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.DeploymentOutStandardArgsQuantization2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksE.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksE.g.cs index a62fddbc..dc238df5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksE.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksE.g.cs @@ -20,7 +20,7 @@ public sealed class HFTasksEJsonConverter : global::System.Text.Json.Serializati { return global::DeepInfra.HFTasksEExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksENullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksENullable.g.cs index aa3629e8..a5909eb5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksENullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HFTasksENullable.g.cs @@ -20,7 +20,7 @@ public sealed class HFTasksENullableJsonConverter : global::System.Text.Json.Ser { return global::DeepInfra.HFTasksEExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionType.g.cs index 1dcbea02..78e95e4a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionType.g.cs @@ -20,7 +20,7 @@ public sealed class HardwareOptionTypeJsonConverter : global::System.Text.Json.S { return global::DeepInfra.HardwareOptionTypeExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionTypeNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionTypeNullable.g.cs index 3d0f0b79..42ff1e54 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionTypeNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.HardwareOptionTypeNullable.g.cs @@ -20,7 +20,7 @@ public sealed class HardwareOptionTypeNullableJsonConverter : global::System.Tex { return global::DeepInfra.HardwareOptionTypeExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetail.g.cs index 994099bc..e014c830 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetail.g.cs @@ -20,7 +20,7 @@ public sealed class ImageURLDetailJsonConverter : global::System.Text.Json.Seria { return global::DeepInfra.ImageURLDetailExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetailNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetailNullable.g.cs index 03b92452..a7eca6ad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetailNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ImageURLDetailNullable.g.cs @@ -20,7 +20,7 @@ public sealed class ImageURLDetailNullableJsonConverter : global::System.Text.Js { return global::DeepInfra.ImageURLDetailExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormat.g.cs index 528f2499..896b10ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormat.g.cs @@ -20,7 +20,7 @@ public sealed class InputAudioFormatJsonConverter : global::System.Text.Json.Ser { return global::DeepInfra.InputAudioFormatExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormatNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormatNullable.g.cs index ff440e33..a0960037 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormatNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputAudioFormatNullable.g.cs @@ -20,7 +20,7 @@ public sealed class InputAudioFormatNullableJsonConverter : global::System.Text. { return global::DeepInfra.InputAudioFormatExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputVariant2ItemVariant2Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputVariant2ItemVariant2Item.g.cs new file mode 100644 index 00000000..5fedcb08 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.InputVariant2ItemVariant2Item.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 // Type or member is obsolete + +namespace DeepInfra.JsonConverters +{ + /// + public class InputVariant2ItemVariant2ItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.InputVariant2ItemVariant2Item 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."); + + + var readerCopy = reader; + var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator)}"); + var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo); + + global::DeepInfra.ChatCompletionContentPartText? text = default; + if (discriminator?.Type == global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.Text) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::DeepInfra.ChatCompletionContentPartText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::DeepInfra.ChatCompletionContentPartText)}"); + text = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + global::DeepInfra.ChatCompletionContentPartImage? imageUrl = default; + if (discriminator?.Type == global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.ImageUrl) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::DeepInfra.ChatCompletionContentPartImage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::DeepInfra.ChatCompletionContentPartImage)}"); + imageUrl = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } + + var __value = new global::DeepInfra.InputVariant2ItemVariant2Item( + discriminator?.Type, + text, + + imageUrl + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.InputVariant2ItemVariant2Item 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.IsText) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::DeepInfra.ChatCompletionContentPartText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::DeepInfra.ChatCompletionContentPartText).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text!, typeInfo); + } + else if (value.IsImageUrl) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::DeepInfra.ChatCompletionContentPartImage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::DeepInfra.ChatCompletionContentPartImage).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.ImageUrl!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKey.g.cs index 17ba4ef7..fe449a1e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKey.g.cs @@ -20,7 +20,7 @@ public sealed class ModelDocBlockKeyJsonConverter : global::System.Text.Json.Ser { return global::DeepInfra.ModelDocBlockKeyExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKeyNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKeyNullable.g.cs index 17f3d415..205698fc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKeyNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelDocBlockKeyNullable.g.cs @@ -20,7 +20,7 @@ public sealed class ModelDocBlockKeyNullableJsonConverter : global::System.Text. { return global::DeepInfra.ModelDocBlockKeyExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProvider.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProvider.g.cs index 30daf8ef..a46f0fee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProvider.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProvider.g.cs @@ -20,7 +20,7 @@ public sealed class ModelProviderJsonConverter : global::System.Text.Json.Serial { return global::DeepInfra.ModelProviderExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProviderNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProviderNullable.g.cs index 503d70ef..c481ed84 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProviderNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ModelProviderNullable.g.cs @@ -20,7 +20,7 @@ public sealed class ModelProviderNullableJsonConverter : global::System.Text.Jso { return global::DeepInfra.ModelProviderExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OneOf4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OneOf4.g.cs new file mode 100644 index 00000000..9350333f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OneOf4.g.cs @@ -0,0 +1,271 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::DeepInfra.OneOf 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 __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; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + T4? value4 = 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) + { + } + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == 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) + { + 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) + { + 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) + { + 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) + { + } + } + + var __value = new global::DeepInfra.OneOf( + value1, + + value2, + + value3, + + value4 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OneOf 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); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpoint.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpoint.g.cs index 0bc552c8..768d9eba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpoint.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpoint.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIBatchesInEndpointJsonConverter : global::System.Text.J { return global::DeepInfra.OpenAIBatchesInEndpointExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpointNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpointNullable.g.cs index e4a09eb6..106f2d02 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpointNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIBatchesInEndpointNullable.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIBatchesInEndpointNullableJsonConverter : global::Syste { return global::DeepInfra.OpenAIBatchesInEndpointExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2.g.cs index 3461ce5f..ffdfa806 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIChatCompletionsInReasoningEffort2JsonConverter : globa { return global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2Extensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2Nullable.g.cs index 75f77ba9..e9a623ab 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2Nullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2Nullable.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIChatCompletionsInReasoningEffort2NullableJsonConverter { return global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2Extensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoice.g.cs new file mode 100644 index 00000000..d8c81a4f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoice.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIChatCompletionsInToolChoiceJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIChatCompletionsInToolChoice 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.OpenAIChatCompletionsInToolChoiceExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIChatCompletionsInToolChoice)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIChatCompletionsInToolChoice); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIChatCompletionsInToolChoice value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.OpenAIChatCompletionsInToolChoiceExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoiceNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoiceNullable.g.cs new file mode 100644 index 00000000..6acbb5b8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoiceNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIChatCompletionsInToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIChatCompletionsInToolChoice? 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.OpenAIChatCompletionsInToolChoiceExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIChatCompletionsInToolChoice)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIChatCompletionsInToolChoice?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIChatCompletionsInToolChoice? 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.OpenAIChatCompletionsInToolChoiceExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormat.g.cs index 0d01b4b2..977725f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormat.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIEmbeddingsInEncodingFormatJsonConverter : global::Syst { return global::DeepInfra.OpenAIEmbeddingsInEncodingFormatExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormatNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormatNullable.g.cs index aa7b51b8..0f987e66 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormatNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormatNullable.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIEmbeddingsInEncodingFormatNullableJsonConverter : glob { return global::DeepInfra.OpenAIEmbeddingsInEncodingFormatExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2.g.cs new file mode 100644 index 00000000..60ff650c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIEmbeddingsInInputType2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIEmbeddingsInInputType2 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.OpenAIEmbeddingsInInputType2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIEmbeddingsInInputType2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIEmbeddingsInInputType2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIEmbeddingsInInputType2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.OpenAIEmbeddingsInInputType2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2Nullable.g.cs new file mode 100644 index 00000000..bca2728d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIEmbeddingsInInputType2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIEmbeddingsInInputType2? 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.OpenAIEmbeddingsInInputType2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIEmbeddingsInInputType2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIEmbeddingsInInputType2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIEmbeddingsInInputType2? 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.OpenAIEmbeddingsInInputType2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.g.cs new file mode 100644 index 00000000..1e87352e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType 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.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeNullable.g.cs new file mode 100644 index 00000000..c45e2c1f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? 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.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? 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.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIFilePurpose.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIFilePurpose.g.cs new file mode 100644 index 00000000..922c7e61 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIFilePurpose.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIFilePurposeJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIFilePurpose 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.OpenAIFilePurposeExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIFilePurpose)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIFilePurpose); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIFilePurpose value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.OpenAIFilePurposeExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIFilePurposeNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIFilePurposeNullable.g.cs new file mode 100644 index 00000000..d8d9b3df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIFilePurposeNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenAIFilePurposeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenAIFilePurpose? 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.OpenAIFilePurposeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenAIFilePurpose)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenAIFilePurpose?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenAIFilePurpose? 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.OpenAIFilePurposeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormat.g.cs index e9801291..8efc3608 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormat.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIImagesResponseFormatJsonConverter : global::System.Tex { return global::DeepInfra.OpenAIImagesResponseFormatExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormatNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormatNullable.g.cs index d55c7503..32d55249 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormatNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIImagesResponseFormatNullable.g.cs @@ -20,7 +20,7 @@ public sealed class OpenAIImagesResponseFormatNullableJsonConverter : global::Sy { return global::DeepInfra.OpenAIImagesResponseFormatExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: 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..08ef990e --- /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..a50b12b4 --- /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.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..0424f5be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PresetConfigOutStandardArgsKvCacheDtype2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2 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.PresetConfigOutStandardArgsKvCacheDtype2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2Nullable.g.cs new file mode 100644 index 00000000..4f296a6e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PresetConfigOutStandardArgsKvCacheDtype2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2? 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.PresetConfigOutStandardArgsKvCacheDtype2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2? 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.PresetConfigOutStandardArgsKvCacheDtype2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2.g.cs new file mode 100644 index 00000000..f20dabcf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PresetConfigOutStandardArgsQuantization2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PresetConfigOutStandardArgsQuantization2 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.PresetConfigOutStandardArgsQuantization2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PresetConfigOutStandardArgsQuantization2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PresetConfigOutStandardArgsQuantization2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PresetConfigOutStandardArgsQuantization2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.PresetConfigOutStandardArgsQuantization2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2Nullable.g.cs new file mode 100644 index 00000000..e12af42e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PresetConfigOutStandardArgsQuantization2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PresetConfigOutStandardArgsQuantization2? 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.PresetConfigOutStandardArgsQuantization2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PresetConfigOutStandardArgsQuantization2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PresetConfigOutStandardArgsQuantization2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PresetConfigOutStandardArgsQuantization2? 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.PresetConfigOutStandardArgsQuantization2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingType.g.cs index c7737d21..c2768c93 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingType.g.cs @@ -20,7 +20,7 @@ public sealed class PricingTypeJsonConverter : global::System.Text.Json.Serializ { return global::DeepInfra.PricingTypeExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingTypeNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingTypeNullable.g.cs index 72df5d71..f36a1669 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingTypeNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PricingTypeNullable.g.cs @@ -20,7 +20,7 @@ public sealed class PricingTypeNullableJsonConverter : global::System.Text.Json. { return global::DeepInfra.PricingTypeExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsMode2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsMode2.g.cs new file mode 100644 index 00000000..1b9b8769 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsMode2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PromptCacheOptionsMode2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PromptCacheOptionsMode2 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.PromptCacheOptionsMode2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PromptCacheOptionsMode2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PromptCacheOptionsMode2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PromptCacheOptionsMode2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.PromptCacheOptionsMode2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsMode2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsMode2Nullable.g.cs new file mode 100644 index 00000000..d74122e6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsMode2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PromptCacheOptionsMode2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PromptCacheOptionsMode2? 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.PromptCacheOptionsMode2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PromptCacheOptionsMode2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PromptCacheOptionsMode2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PromptCacheOptionsMode2? 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.PromptCacheOptionsMode2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsTtl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsTtl2.g.cs new file mode 100644 index 00000000..1062b606 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsTtl2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PromptCacheOptionsTtl2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PromptCacheOptionsTtl2 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.PromptCacheOptionsTtl2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PromptCacheOptionsTtl2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PromptCacheOptionsTtl2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PromptCacheOptionsTtl2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.PromptCacheOptionsTtl2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsTtl2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsTtl2Nullable.g.cs new file mode 100644 index 00000000..b27a3b22 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.PromptCacheOptionsTtl2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class PromptCacheOptionsTtl2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.PromptCacheOptionsTtl2? 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.PromptCacheOptionsTtl2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.PromptCacheOptionsTtl2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.PromptCacheOptionsTtl2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.PromptCacheOptionsTtl2? 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.PromptCacheOptionsTtl2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.RebalanceStatusDirection.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.RebalanceStatusDirection.g.cs new file mode 100644 index 00000000..c41b74c5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.RebalanceStatusDirection.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class RebalanceStatusDirectionJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.RebalanceStatusDirection 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.RebalanceStatusDirectionExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.RebalanceStatusDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.RebalanceStatusDirection); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.RebalanceStatusDirection value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.RebalanceStatusDirectionExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.RebalanceStatusDirectionNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.RebalanceStatusDirectionNullable.g.cs new file mode 100644 index 00000000..2bcc002e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.RebalanceStatusDirectionNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class RebalanceStatusDirectionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.RebalanceStatusDirection? 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.RebalanceStatusDirectionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.RebalanceStatusDirection)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.RebalanceStatusDirection?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.RebalanceStatusDirection? 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.RebalanceStatusDirectionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKey.g.cs index ae2d711a..c6857459 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKey.g.cs @@ -20,7 +20,7 @@ public sealed class SchemaVariantKeyJsonConverter : global::System.Text.Json.Ser { return global::DeepInfra.SchemaVariantKeyExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKeyNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKeyNullable.g.cs index d0738117..4b2b053d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKeyNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SchemaVariantKeyNullable.g.cs @@ -20,7 +20,7 @@ public sealed class SchemaVariantKeyNullableJsonConverter : global::System.Text. { return global::DeepInfra.SchemaVariantKeyExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTier.g.cs index 5144d085..2b6bd509 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTier.g.cs @@ -20,7 +20,7 @@ public sealed class ServiceTierJsonConverter : global::System.Text.Json.Serializ { return global::DeepInfra.ServiceTierExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTierNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTierNullable.g.cs index b8879e5f..96c0c0a3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTierNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ServiceTierNullable.g.cs @@ -20,7 +20,7 @@ public sealed class ServiceTierNullableJsonConverter : global::System.Text.Json. { return global::DeepInfra.ServiceTierExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnum.g.cs index e32000da..72c09ecd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnum.g.cs @@ -20,7 +20,7 @@ public sealed class SourceTypeEnumJsonConverter : global::System.Text.Json.Seria { return global::DeepInfra.SourceTypeEnumExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnumNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnumNullable.g.cs index c4e30595..cb38d0f0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnumNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SourceTypeEnumNullable.g.cs @@ -20,7 +20,7 @@ public sealed class SourceTypeEnumNullableJsonConverter : global::System.Text.Js { return global::DeepInfra.SourceTypeEnumExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..f418b25f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class StandardArgsKvCacheDtype2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.StandardArgsKvCacheDtype2 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.StandardArgsKvCacheDtype2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.StandardArgsKvCacheDtype2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.StandardArgsKvCacheDtype2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.StandardArgsKvCacheDtype2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.StandardArgsKvCacheDtype2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2Nullable.g.cs new file mode 100644 index 00000000..e7461533 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class StandardArgsKvCacheDtype2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.StandardArgsKvCacheDtype2? 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.StandardArgsKvCacheDtype2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.StandardArgsKvCacheDtype2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.StandardArgsKvCacheDtype2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.StandardArgsKvCacheDtype2? 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.StandardArgsKvCacheDtype2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsQuantization2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsQuantization2.g.cs new file mode 100644 index 00000000..58eb516b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsQuantization2.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class StandardArgsQuantization2JsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.StandardArgsQuantization2 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.StandardArgsQuantization2Extensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.StandardArgsQuantization2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.StandardArgsQuantization2); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.StandardArgsQuantization2 value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.StandardArgsQuantization2Extensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsQuantization2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsQuantization2Nullable.g.cs new file mode 100644 index 00000000..149e640c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsQuantization2Nullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class StandardArgsQuantization2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.StandardArgsQuantization2? 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.StandardArgsQuantization2Extensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.StandardArgsQuantization2)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.StandardArgsQuantization2?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.StandardArgsQuantization2? 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.StandardArgsQuantization2Extensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReason.g.cs index 9abfd319..3420d61c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReason.g.cs @@ -20,7 +20,7 @@ public sealed class SuspendReasonJsonConverter : global::System.Text.Json.Serial { return global::DeepInfra.SuspendReasonExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReasonNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReasonNullable.g.cs index b2528c3b..3d792bcf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReasonNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.SuspendReasonNullable.g.cs @@ -20,7 +20,7 @@ public sealed class SuspendReasonNullableJsonConverter : global::System.Text.Jso { return global::DeepInfra.SuspendReasonExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormat.g.cs index c927409b..f4d5ed1f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormat.g.cs @@ -20,7 +20,7 @@ public sealed class TtsResponseFormatJsonConverter : global::System.Text.Json.Se { return global::DeepInfra.TtsResponseFormatExtensions.ToEnum(stringValue) ?? default; } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormatNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormatNullable.g.cs index 96e58e48..85a5fcdf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormatNullable.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.TtsResponseFormatNullable.g.cs @@ -20,7 +20,7 @@ public sealed class TtsResponseFormatNullableJsonConverter : global::System.Text { return global::DeepInfra.TtsResponseFormatExtensions.ToEnum(stringValue); } - + break; } case global::System.Text.Json.JsonTokenType.Number: diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.UnixTimestamp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.UnixTimestamp.g.cs index 6ff3a22c..75071e16 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.UnixTimestamp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.UnixTimestamp.g.cs @@ -19,7 +19,7 @@ public class UnixTimestampJsonConverter : global::System.Text.Json.Serialization { return global::System.DateTimeOffset.FromUnixTimeSeconds(unixTimestamp); } - + return global::System.DateTimeOffset.FromUnixTimeMilliseconds(unixTimestamp); } if (reader.TryGetInt32(out int unixTimestampInt)) diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs index 3fd9bb26..5fd3763d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs @@ -7,7 +7,7 @@ namespace DeepInfra { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, @@ -17,30 +17,26 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.SuspendReasonNullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2JsonConverter), + typeof(global::DeepInfra.JsonConverters.AgentInstanceStateJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.AgentInstanceStateNullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnthropicThinkingConfigType2JsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnthropicThinkingConfigType2NullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2JsonConverter), + typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2JsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2NullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter), + typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), 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), @@ -57,6 +53,14 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.DeployTypeNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.DeploymentOutStandardArgsKvCacheDtype2NullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.DeploymentOutStandardArgsQuantization2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.HFTasksEJsonConverter), typeof(global::DeepInfra.JsonConverters.HFTasksENullableJsonConverter), @@ -85,22 +89,58 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.OpenAIBatchesInEndpointNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoiceJsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenAIChatCompletionsInToolChoiceNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2JsonConverter), typeof(global::DeepInfra.JsonConverters.OpenAIChatCompletionsInReasoningEffort2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeJsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeNullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormatJsonConverter), typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInEncodingFormatNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenAIFilePurposeJsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenAIFilePurposeNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenAIImagesResponseFormatJsonConverter), typeof(global::DeepInfra.JsonConverters.OpenAIImagesResponseFormatNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.PresetConfigOutStandardArgsKvCacheDtype2NullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.PresetConfigOutStandardArgsQuantization2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.PricingTypeJsonConverter), typeof(global::DeepInfra.JsonConverters.PricingTypeNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.PromptCacheOptionsMode2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.PromptCacheOptionsMode2NullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.PromptCacheOptionsTtl2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.PromptCacheOptionsTtl2NullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.RebalanceStatusDirectionJsonConverter), + + typeof(global::DeepInfra.JsonConverters.RebalanceStatusDirectionNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.SchemaVariantKeyJsonConverter), typeof(global::DeepInfra.JsonConverters.SchemaVariantKeyNullableJsonConverter), @@ -113,6 +153,14 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.SourceTypeEnumNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.StandardArgsKvCacheDtype2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.StandardArgsKvCacheDtype2NullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.StandardArgsQuantization2JsonConverter), + + typeof(global::DeepInfra.JsonConverters.StandardArgsQuantization2NullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.TtsResponseFormatJsonConverter), typeof(global::DeepInfra.JsonConverters.TtsResponseFormatNullableJsonConverter), @@ -121,6 +169,12 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.ContainerRentalsListV1ContainersGetStateNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateJsonConverter), + + typeof(global::DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullableJsonConverter), + + typeof(global::DeepInfra.JsonConverters.InputVariant2ItemVariant2ItemJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>), @@ -133,21 +187,21 @@ 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), + typeof(global::DeepInfra.JsonConverters.OneOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), @@ -157,22 +211,28 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, string>), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + 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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] [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.BillingAddressOut))] + [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(global::DeepInfra.PaymentMethodOut))] [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.SuspendReason), TypeInfoPropertyName = "SuspendReason2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ConfigIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ConfigOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeepStartApplicationIn))] @@ -181,7 +241,13 @@ 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.PaymentMethodBank))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PaymentMethodCard))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PaymentMethodCashApp))] [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,43 +260,54 @@ 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.AgentBackupOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentTypeMetaOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentCreateIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentCreateOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentInstanceOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentInstanceState), TypeInfoPropertyName = "AgentInstanceState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentPlanOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentUpdateIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicMessagesIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ServiceTier), TypeInfoPropertyName = "ServiceTier2")] + [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, object>), TypeInfoPropertyName = "AnyOfStringIListAnthropicSystemContentObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicSystemContent))] - [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.AnthropicTool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicThinkingConfig))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicThinkingConfigType2), TypeInfoPropertyName = "AnthropicThinkingConfigType22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicTokenCountRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ApiToken))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTimeOffset))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ApiTokenIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ApiTokenVercelExportIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchErrorData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchErrors))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchInputTokensDetails))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchOutputExpiresAfter))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchOutputTokensDetails))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchRequestCounts))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BatchUsage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyCreateVoiceV1VoicesAddPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2), TypeInfoPropertyName = "BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat22")] [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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2), TypeInfoPropertyName = "BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat22")] [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,18 +319,19 @@ 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.PromptCacheBreakpoint))] + [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))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.FunctionDefinition))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatReasoningSettingsEffort2), TypeInfoPropertyName = "ChatReasoningSettingsEffort22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.CompletionMultiModalData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ContainerRentalOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ContainerRentalStateOut), TypeInfoPropertyName = "ContainerRentalStateOut2")] @@ -263,6 +341,7 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.CreateLoraApiRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SourceModel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeepError))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployArgsHistoryOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployDelete))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployGPUAvailability))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -273,32 +352,45 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.HFWeights))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployLLMIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ScaleSettings))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.StandardArgs))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployLLMUpdateIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployModelIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ModelProvider), TypeInfoPropertyName = "ModelProvider2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployResult))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployRollout))] [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.DeploymentOutStandardArgs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2), TypeInfoPropertyName = "DeploymentOutStandardArgsKvCacheDtype22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentOutStandardArgsQuantization2), TypeInfoPropertyName = "DeploymentOutStandardArgsQuantization22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentStatsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DetailedDeploymentStatsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.LLMDeploymentStatsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.EmbeddingsDeploymentStatsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TimeDeploymentStatsOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DetokenizeIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DetokenizeOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DisplayNameIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ElevenLabsTextToSpeechIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TtsResponseFormat), TypeInfoPropertyName = "TtsResponseFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.EmailsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.FAQEntryOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.FeedbackIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.FunctionDefinition))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.FunctionTool))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.GetVoicesOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.Voice))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.GpuLimitOut))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.GpuLimitRequestIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.GpuPoolOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.GpuPoolRequestIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.GpuTypesOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.HFModel))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.HFTasksE), TypeInfoPropertyName = "HFTasksE2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.HardwareOption))] @@ -328,7 +420,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,39 +429,51 @@ 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))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIBatchesIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIBatchesInEndpoint), TypeInfoPropertyName = "OpenAIBatchesInEndpoint2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIBatchesOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIChatCompletionsIn))] - [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::System.Collections.Generic.IList>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OneOf), TypeInfoPropertyName = "OneOfChatCompletionToolMessageChatCompletionAssistantMessageChatCompletionUserMessageChatCompletionSystemMessage2")] [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::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfStringChatToolsObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfOpenAIChatCompletionsInToolChoiceFunctionToolObject2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIChatCompletionsInToolChoice), TypeInfoPropertyName = "OpenAIChatCompletionsInToolChoice2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfTextResponseFormatJsonObjectResponseFormatJsonSchemaResponseFormatRegexResponseFormatObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TextResponseFormat))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RegexResponseFormat))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.StreamOptions))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2), TypeInfoPropertyName = "OpenAIChatCompletionsInReasoningEffort22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PromptCacheOptions))] [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")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>>), TypeInfoPropertyName = "AnyOfStringIListAnyOfStringIListInputVariant2ItemVariant2Item2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>), TypeInfoPropertyName = "AnyOfStringIListInputVariant2ItemVariant2Item2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.InputVariant2ItemVariant2Item), TypeInfoPropertyName = "InputVariant2ItemVariant2Item2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType), TypeInfoPropertyName = "OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIEmbeddingsInInputType2), TypeInfoPropertyName = "OpenAIEmbeddingsInInputType22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIEmbeddingsInEncodingFormat), TypeInfoPropertyName = "OpenAIEmbeddingsInEncodingFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIFile))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIFilePurpose), TypeInfoPropertyName = "OpenAIFilePurpose2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImageData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesResponseFormat))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesResponseFormat), TypeInfoPropertyName = "OpenAIImagesResponseFormat2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesGenerationsIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] @@ -377,22 +481,36 @@ 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.OpenRouterDatacenter))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterModelData))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterPricing))] - [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.OpenClawLaunchTokenOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterModelsOut))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PresetConfigOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PresetConfigOutStandardArgs))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2), TypeInfoPropertyName = "PresetConfigOutStandardArgsKvCacheDtype22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PresetConfigOutStandardArgsQuantization2), TypeInfoPropertyName = "PresetConfigOutStandardArgsQuantization22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PricingPageEntryOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PricingType), TypeInfoPropertyName = "PricingType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PromptCacheOptionsMode2), TypeInfoPropertyName = "PromptCacheOptionsMode22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.PromptCacheOptionsTtl2), TypeInfoPropertyName = "PromptCacheOptionsTtl22")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RateLimitOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RateLimitRequestIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceCancelIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceCancelOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceStatus))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceStatusDirection), TypeInfoPropertyName = "RebalanceStatusDirection2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RebalanceStatusOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RequestCostItem))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RequestCostQuery))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.RequestCostResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SandboxCreateIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SandboxCreateOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SandboxExecIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SandboxOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SandboxPlanOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SchemaOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SchemaVariantKey), TypeInfoPropertyName = "SchemaVariantKey2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ScopedJWTIn))] @@ -400,62 +518,91 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SourceTypeEnum), TypeInfoPropertyName = "SourceTypeEnum2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SshKeyIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.SshKeyOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.StandardArgsKvCacheDtype2), TypeInfoPropertyName = "StandardArgsKvCacheDtype22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.StandardArgsQuantization2), TypeInfoPropertyName = "StandardArgsQuantization22")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TokenizeIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.TokenizeOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.UpdateLoraApiRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.VideoGenerationIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.VideoGenerationOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.WebLiveMetricsOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.WebSearchTool))] [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))] + [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::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>))] - [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::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::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))] [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))] - [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::DeepInfra.AnyOf>>>))] + [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::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))] [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))] [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))] + [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..b2177c9b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs @@ -6,1193 +6,1510 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class JsonSerializerContextTypes { /// - /// + /// /// public global::System.Collections.Generic.Dictionary? StringStringDictionary { get; set; } /// - /// + /// /// public global::System.Collections.Generic.Dictionary? StringObjectDictionary { get; set; } /// - /// + /// Runtime object lists used by dynamic JSON payloads such as tool arguments. + /// + public global::System.Collections.Generic.List? ObjectList { get; set; } + + /// + /// /// public global::System.Text.Json.JsonElement? JsonElement { get; set; } /// - /// + /// /// public global::DeepInfra.AddFundsIn? Type0 { get; set; } /// - /// + /// /// public int? Type1 { get; set; } /// - /// + /// /// - public global::DeepInfra.BillingPortalOut? Type2 { get; set; } + public global::DeepInfra.AddFundsOut? Type2 { get; set; } /// - /// + /// /// public string? Type3 { get; set; } /// - /// + /// + /// + public object? Type4 { get; set; } + /// + /// + /// + public global::DeepInfra.BillingAddressOut? Type5 { get; set; } + /// + /// + /// + public global::DeepInfra.BillingPortalOut? Type6 { get; set; } + /// + /// + /// + public global::DeepInfra.Checklist? Type7 { get; set; } + /// + /// + /// + public bool? Type8 { get; set; } + /// + /// + /// + public global::DeepInfra.PaymentMethodOut? Type9 { get; set; } + /// + /// + /// + public double? Type10 { get; set; } + /// + /// + /// + public global::DeepInfra.SuspendReason? Type11 { get; set; } + /// + /// + /// + public global::DeepInfra.ConfigIn? Type12 { get; set; } + /// + /// + /// + public global::DeepInfra.ConfigOut? Type13 { get; set; } + /// + /// + /// + public global::DeepInfra.DeepStartApplicationIn? Type14 { get; set; } + /// + /// + /// + public global::DeepInfra.DeepStartApplicationOut? Type15 { get; set; } + /// + /// + /// + public global::DeepInfra.DiscountMeta? Type16 { get; set; } + /// + /// + /// + public global::DeepInfra.HTTPValidationError? Type17 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type18 { get; set; } + /// + /// + /// + public global::DeepInfra.ValidationError? Type19 { get; set; } + /// + /// + /// + public global::DeepInfra.InvoiceListItem? Type20 { get; set; } + /// + /// + /// + public global::DeepInfra.InvoicesOut? Type21 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type22 { get; set; } + /// + /// + /// + public global::DeepInfra.ModelMeta? Type23 { get; set; } + /// + /// + /// + public global::DeepInfra.PaymentMethodBank? Type24 { get; set; } + /// + /// + /// + public global::DeepInfra.PaymentMethodCard? Type25 { get; set; } + /// + /// + /// + public global::DeepInfra.PaymentMethodCashApp? Type26 { get; set; } + /// + /// + /// + public global::DeepInfra.TimeInterval? Type27 { get; set; } + /// + /// + /// + public long? Type28 { get; set; } + /// + /// + /// + public global::DeepInfra.TopUpIn? Type29 { get; set; } + /// + /// + /// + public global::DeepInfra.UsageItem? Type30 { get; set; } + /// + /// + /// + public global::DeepInfra.UsageMonth? Type31 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type32 { get; set; } + /// + /// + /// + public global::DeepInfra.UsageOut? Type33 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type34 { get; set; } + /// + /// + /// + public global::DeepInfra.UsageRentOut? Type35 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type36 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type37 { get; set; } + /// + /// + /// + public global::DeepInfra.AnyOf? Type38 { get; set; } + /// + /// + /// + public global::DeepInfra.AgentBackupOut? Type39 { get; set; } + /// + /// /// - public global::DeepInfra.Checklist? Type4 { get; set; } + public global::System.Collections.Generic.Dictionary? Type40 { get; set; } /// - /// + /// /// - public bool? Type5 { get; set; } + public global::DeepInfra.AgentTypeMetaOut? Type41 { get; set; } /// - /// + /// /// - public double? Type6 { get; set; } + public global::DeepInfra.AgentCreateIn? Type42 { get; set; } /// - /// + /// /// - public object? Type7 { get; set; } + public global::DeepInfra.AgentCreateOut? Type43 { get; set; } /// - /// + /// /// - public global::DeepInfra.SuspendReason? Type8 { get; set; } + public global::DeepInfra.AgentInstanceOut? Type44 { get; set; } /// - /// + /// /// - public global::DeepInfra.ConfigIn? Type9 { get; set; } + public global::DeepInfra.AgentInstanceState? Type45 { get; set; } /// - /// + /// /// - public global::DeepInfra.ConfigOut? Type10 { get; set; } + public global::DeepInfra.AgentPlanOut? Type46 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeepStartApplicationIn? Type11 { get; set; } + public global::System.Collections.Generic.IList? Type47 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeepStartApplicationOut? Type12 { get; set; } + public global::DeepInfra.AgentUpdateIn? Type48 { get; set; } /// - /// + /// /// - public global::DeepInfra.DiscountMeta? Type13 { get; set; } + public global::DeepInfra.AnthropicMessagesIn? Type49 { get; set; } /// - /// + /// /// - public global::DeepInfra.HTTPValidationError? Type14 { get; set; } + public global::DeepInfra.ServiceTier? Type50 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type15 { get; set; } + public global::System.Collections.Generic.IList? Type51 { get; set; } /// - /// + /// /// - public global::DeepInfra.ValidationError? Type16 { get; set; } + public global::System.Collections.Generic.IList? Type52 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelMeta? Type17 { get; set; } + public global::DeepInfra.AnyOf, object>? Type53 { get; set; } /// - /// + /// /// - public global::DeepInfra.TimeInterval? Type18 { get; set; } + public global::System.Collections.Generic.IList? Type54 { get; set; } /// - /// + /// /// - public long? Type19 { get; set; } + public global::DeepInfra.AnthropicSystemContent? Type55 { get; set; } /// - /// + /// /// - public global::DeepInfra.TopUpIn? Type20 { get; set; } + public global::System.Collections.Generic.IList? Type56 { get; set; } /// - /// + /// /// - public global::DeepInfra.UsageItem? Type21 { get; set; } + public global::DeepInfra.AnthropicTool? Type57 { get; set; } /// - /// + /// /// - public global::DeepInfra.UsageMonth? Type22 { get; set; } + public global::DeepInfra.AnthropicThinkingConfig? Type58 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type23 { get; set; } + public global::DeepInfra.AnthropicThinkingConfigType2? Type59 { get; set; } /// - /// + /// /// - public global::DeepInfra.UsageOut? Type24 { get; set; } + public global::DeepInfra.AnthropicTokenCountRequest? Type60 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type25 { get; set; } + public global::DeepInfra.ApiToken? Type61 { get; set; } /// - /// + /// /// - public global::DeepInfra.UsageRentOut? Type26 { get; set; } + public global::System.DateTimeOffset? Type62 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.Dictionary? Type27 { get; set; } + public global::DeepInfra.ApiTokenIn? Type63 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList>? Type28 { get; set; } + public global::DeepInfra.ApiTokenVercelExportIn? Type64 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type29 { get; set; } + public global::DeepInfra.BatchErrorData? Type65 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnthropicMessagesIn? Type30 { get; set; } + public global::DeepInfra.BatchErrors? Type66 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type31 { get; set; } + public global::System.Collections.Generic.IList? Type67 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, object>? Type32 { get; set; } + public global::DeepInfra.BatchInputTokensDetails? Type68 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type33 { get; set; } + public global::DeepInfra.BatchOutputExpiresAfter? Type69 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnthropicSystemContent? Type34 { get; set; } + public global::DeepInfra.BatchOutputTokensDetails? Type70 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type35 { get; set; } + public global::DeepInfra.BatchRequestCounts? Type71 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type36 { get; set; } + public global::DeepInfra.BatchUsage? Type72 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnthropicTool? Type37 { get; set; } + public global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? Type73 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnthropicThinkingConfig? Type38 { get; set; } + public global::System.Collections.Generic.IList? Type74 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnthropicTokenCountRequest? Type39 { get; set; } + public byte[]? Type75 { get; set; } /// - /// + /// /// - public global::DeepInfra.ApiToken? Type40 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? Type76 { get; set; } /// - /// + /// /// - public global::System.DateTimeOffset? Type41 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? Type77 { get; set; } /// - /// + /// /// - public global::DeepInfra.ApiTokenIn? Type42 { get; set; } + public global::System.Collections.Generic.IList? Type78 { get; set; } /// - /// + /// /// - public global::DeepInfra.ApiTokenVercelExportIn? Type43 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type79 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? Type44 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? Type80 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type45 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? Type81 { get; set; } /// - /// + /// /// - public byte[]? Type46 { get; set; } + public global::DeepInfra.BodyOpenaiFilesV1FilesPost? Type82 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? Type47 { get; set; } + public global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? Type83 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? Type48 { get; set; } + public global::DeepInfra.OpenAIImagesEditsIn? Type84 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type49 { get; set; } + public global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? Type85 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type50 { get; set; } + public global::DeepInfra.OpenAIImagesVariationsIn? Type86 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? Type51 { get; set; } + public global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? Type87 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? Type52 { get; set; } + public global::DeepInfra.ChatCompletionAssistantMessage? Type88 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type53 { get; set; } + public global::DeepInfra.AnyOf, object>? Type89 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type54 { get; set; } + public global::System.Collections.Generic.IList? Type90 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? Type55 { get; set; } + public global::DeepInfra.ChatCompletionContentPartText? Type91 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? Type56 { get; set; } + public global::System.Collections.Generic.IList? Type92 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? Type57 { get; set; } + public global::DeepInfra.ChatCompletionMessageToolCall? Type93 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? Type58 { get; set; } + public global::DeepInfra.ChatCompletionContentPartAudio? Type94 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiFilesV1FilesPost? Type59 { get; set; } + public global::DeepInfra.InputAudio? Type95 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? Type60 { get; set; } + public global::DeepInfra.ChatCompletionContentPartImage? Type96 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? Type61 { get; set; } + public global::DeepInfra.ImageURL? Type97 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIImagesEditsIn? Type62 { get; set; } + public global::DeepInfra.PromptCacheBreakpoint? Type98 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? Type63 { get; set; } + public global::DeepInfra.ChatCompletionContentPartVideo? Type99 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? Type64 { get; set; } + public global::DeepInfra.VideoURL? Type100 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIImagesVariationsIn? Type65 { get; set; } + public global::DeepInfra.Function? Type101 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? Type66 { get; set; } + public global::DeepInfra.ChatCompletionSystemMessage? Type102 { get; set; } /// - /// + /// /// - public global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? Type67 { get; set; } + public global::DeepInfra.AnyOf>? Type103 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionAssistantMessage? Type68 { get; set; } + public global::DeepInfra.ChatCompletionToolMessage? Type104 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, object>? Type69 { get; set; } + public global::DeepInfra.ChatCompletionUserMessage? Type105 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::DeepInfra.ChatReasoningSettings? Type106 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionContentPartText? Type71 { get; set; } + public global::DeepInfra.ChatReasoningSettingsEffort2? Type107 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type72 { get; set; } + public global::DeepInfra.CompletionMultiModalData? Type108 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionMessageToolCall? Type73 { get; set; } + public global::DeepInfra.ContainerRentalOut? Type109 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionContentPartAudio? Type74 { get; set; } + public global::DeepInfra.ContainerRentalStateOut? Type110 { get; set; } /// - /// + /// /// - public global::DeepInfra.InputAudio? Type75 { get; set; } + public global::DeepInfra.ContainerRentalStartIn? Type111 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionContentPartImage? Type76 { get; set; } + public global::DeepInfra.ContainerRentalStartOut? Type112 { get; set; } /// - /// + /// /// - public global::DeepInfra.ImageURL? Type77 { get; set; } + public global::DeepInfra.ContainerRentalUpdateIn? Type113 { get; set; } /// - /// + /// /// - public global::DeepInfra.Function? Type78 { get; set; } + public global::DeepInfra.CreateLoraApiRequest? Type114 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionSystemMessage? Type79 { get; set; } + public global::DeepInfra.SourceModel? Type115 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf>? Type80 { get; set; } + public global::DeepInfra.DeepError? Type116 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionToolMessage? Type81 { get; set; } + public global::DeepInfra.DeployArgsHistoryOut? Type117 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatCompletionUserMessage? Type82 { get; set; } + public global::DeepInfra.DeployDelete? Type118 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf>>? Type83 { get; set; } + public global::DeepInfra.DeployGPUAvailability? Type119 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList>? Type84 { get; set; } + public global::System.Collections.Generic.IList? Type120 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type85 { get; set; } + public global::DeepInfra.GPUAvailabilityInfo? Type121 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatReasoningSettings? Type86 { get; set; } + public global::DeepInfra.DeployGPUs? Type122 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatReasoningSettingsEffort2? Type87 { get; set; } + public global::DeepInfra.DeployInstances? Type123 { get; set; } /// - /// + /// /// - public global::DeepInfra.ChatTools? Type88 { get; set; } + public global::DeepInfra.DeployLLMConfig? Type124 { get; set; } /// - /// + /// /// - public global::DeepInfra.FunctionDefinition? Type89 { get; set; } + public global::DeepInfra.HFWeights? Type125 { get; set; } /// - /// + /// /// - public global::DeepInfra.CompletionMultiModalData? Type90 { get; set; } + public global::DeepInfra.DeployLLMIn? Type126 { get; set; } /// - /// + /// /// - public global::DeepInfra.ContainerRentalOut? Type91 { get; set; } + public global::DeepInfra.ScaleSettings? Type127 { get; set; } /// - /// + /// /// - public global::DeepInfra.ContainerRentalStateOut? Type92 { get; set; } + public global::DeepInfra.StandardArgs? Type128 { get; set; } /// - /// + /// /// - public global::DeepInfra.ContainerRentalStartIn? Type93 { get; set; } + public global::DeepInfra.DeployLLMUpdateIn? Type129 { get; set; } /// - /// + /// /// - public global::DeepInfra.ContainerRentalStartOut? Type94 { get; set; } + public global::DeepInfra.DeployModelIn? Type130 { get; set; } /// - /// + /// /// - public global::DeepInfra.ContainerRentalUpdateIn? Type95 { get; set; } + public global::DeepInfra.ModelProvider? Type131 { get; set; } /// - /// + /// /// - public global::DeepInfra.CreateLoraApiRequest? Type96 { get; set; } + public global::DeepInfra.DeployResult? Type132 { get; set; } /// - /// + /// /// - public global::DeepInfra.SourceModel? Type97 { get; set; } + public global::DeepInfra.DeployRollout? Type133 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeepError? Type98 { get; set; } + public global::DeepInfra.DeployStatusOut? Type134 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployDelete? Type99 { get; set; } + public global::DeepInfra.DeployType? Type135 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployGPUAvailability? Type100 { get; set; } + public global::DeepInfra.DeploymentLogQueryOut? Type136 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type101 { get; set; } + public global::System.Collections.Generic.Dictionary>>? Type137 { get; set; } /// - /// + /// /// - public global::DeepInfra.GPUAvailabilityInfo? Type102 { get; set; } + public global::System.Collections.Generic.IList>? Type138 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployGPUs? Type103 { get; set; } + public global::DeepInfra.DeploymentMainStatsOut? Type139 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployInstances? Type104 { get; set; } + public global::DeepInfra.DeploymentOut? Type140 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployLLMConfig? Type105 { get; set; } + public global::DeepInfra.DeploymentOutStandardArgs? Type141 { get; set; } /// - /// + /// /// - public global::DeepInfra.HFWeights? Type106 { get; set; } + public global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2? Type142 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployLLMIn? Type107 { get; set; } + public global::DeepInfra.DeploymentOutStandardArgsQuantization2? Type143 { get; set; } /// - /// + /// /// - public global::DeepInfra.ScaleSettings? Type108 { get; set; } + public global::DeepInfra.DeploymentStatsOut? Type144 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployLLMUpdateIn? Type109 { get; set; } + public global::DeepInfra.DetailedDeploymentStatsOut? Type145 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployModelIn? Type110 { get; set; } + public global::DeepInfra.LLMDeploymentStatsOut? Type146 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelProvider? Type111 { get; set; } + public global::DeepInfra.EmbeddingsDeploymentStatsOut? Type147 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployResult? Type112 { get; set; } + public global::DeepInfra.TimeDeploymentStatsOut? Type148 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployStatusOut? Type113 { get; set; } + public global::DeepInfra.DetokenizeIn? Type149 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeployType? Type114 { get; set; } + public global::System.Collections.Generic.IList? Type150 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeploymentLogQueryOut? Type115 { get; set; } + public global::DeepInfra.DetokenizeOut? Type151 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.Dictionary>? Type116 { get; set; } + public global::DeepInfra.DisplayNameIn? Type152 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeploymentMainStatsOut? Type117 { get; set; } + public global::DeepInfra.ElevenLabsTextToSpeechIn? Type153 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeploymentOut? Type118 { get; set; } + public global::DeepInfra.TtsResponseFormat? Type154 { get; set; } /// - /// + /// /// - public global::DeepInfra.DeploymentStatsOut? Type119 { get; set; } + public global::DeepInfra.EmailsOut? Type155 { get; set; } /// - /// + /// /// - public global::DeepInfra.DetailedDeploymentStatsOut? Type120 { get; set; } + public global::DeepInfra.FAQEntryOut? Type156 { get; set; } /// - /// + /// /// - public global::DeepInfra.LLMDeploymentStatsOut? Type121 { get; set; } + public global::DeepInfra.FeedbackIn? Type157 { get; set; } /// - /// + /// /// - public global::DeepInfra.EmbeddingsDeploymentStatsOut? Type122 { get; set; } + public global::DeepInfra.FunctionDefinition? Type158 { get; set; } /// - /// + /// /// - public global::DeepInfra.TimeDeploymentStatsOut? Type123 { get; set; } + public global::DeepInfra.FunctionTool? Type159 { get; set; } /// - /// + /// /// - public global::DeepInfra.DisplayNameIn? Type124 { get; set; } + public global::DeepInfra.GetVoicesOut? Type160 { get; set; } /// - /// + /// /// - public global::DeepInfra.ElevenLabsTextToSpeechIn? Type125 { get; set; } + public global::System.Collections.Generic.IList? Type161 { get; set; } /// - /// + /// /// - public global::DeepInfra.TtsResponseFormat? Type126 { get; set; } + public global::DeepInfra.Voice? Type162 { get; set; } /// - /// + /// /// - public global::DeepInfra.EmailsOut? Type127 { get; set; } + public global::DeepInfra.GpuPoolOut? Type163 { get; set; } /// - /// + /// /// - public global::DeepInfra.FAQEntryOut? Type128 { get; set; } + public global::DeepInfra.GpuPoolRequestIn? Type164 { get; set; } /// - /// + /// /// - public global::DeepInfra.FeedbackIn? Type129 { get; set; } + public global::DeepInfra.GpuTypesOut? Type165 { get; set; } /// - /// + /// /// - public global::DeepInfra.GetVoicesOut? Type130 { get; set; } + public global::System.Collections.Generic.IList? Type166 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type131 { get; set; } + public global::DeepInfra.HFModel? Type167 { get; set; } /// - /// + /// /// - public global::DeepInfra.Voice? Type132 { get; set; } + public global::DeepInfra.HFTasksE? Type168 { get; set; } /// - /// + /// /// - public global::DeepInfra.GpuLimitOut? Type133 { get; set; } + public global::DeepInfra.HardwareOption? Type169 { get; set; } /// - /// + /// /// - public global::DeepInfra.GpuLimitRequestIn? Type134 { get; set; } + public global::DeepInfra.HardwareOptionType? Type170 { get; set; } /// - /// + /// /// - public global::DeepInfra.HFModel? Type135 { get; set; } + public global::DeepInfra.AnyOf? Type171 { get; set; } /// - /// + /// /// - public global::DeepInfra.HFTasksE? Type136 { get; set; } + public global::DeepInfra.HardwarePricingServerless? Type172 { get; set; } /// - /// + /// /// - public global::DeepInfra.HardwareOption? Type137 { get; set; } + public global::DeepInfra.HardwarePricingDedicated? Type173 { get; set; } /// - /// + /// /// - public global::DeepInfra.HardwareOptionType? Type138 { get; set; } + public global::DeepInfra.HardwareResponse? Type174 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type139 { get; set; } + public global::System.Collections.Generic.IList? Type175 { get; set; } /// - /// + /// /// - public global::DeepInfra.HardwarePricingServerless? Type140 { get; set; } + public global::DeepInfra.ImageURLDetail? Type176 { get; set; } /// - /// + /// /// - public global::DeepInfra.HardwarePricingDedicated? Type141 { get; set; } + public global::DeepInfra.InputAudioFormat? Type177 { get; set; } /// - /// + /// /// - public global::DeepInfra.HardwareResponse? Type142 { get; set; } + public global::DeepInfra.InspectScopedJWTOut? Type178 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type143 { get; set; } + public global::DeepInfra.JsonObjectResponseFormat? Type179 { get; set; } /// - /// + /// /// - public global::DeepInfra.ImageURLDetail? Type144 { get; set; } + public global::DeepInfra.JsonSchema? Type180 { get; set; } /// - /// + /// /// - public global::DeepInfra.InputAudioFormat? Type145 { get; set; } + public global::DeepInfra.JsonSchemaResponseFormat? Type181 { get; set; } /// - /// + /// /// - public global::DeepInfra.InspectScopedJWTOut? Type146 { get; set; } + public global::DeepInfra.LogQueryOut? Type182 { get; set; } /// - /// + /// /// - public global::DeepInfra.JsonObjectResponseFormat? Type147 { get; set; } + public global::DeepInfra.LoraModelUploadIn? Type183 { get; set; } /// - /// + /// /// - public global::DeepInfra.JsonSchema? Type148 { get; set; } + public global::DeepInfra.Me? Type184 { get; set; } /// - /// + /// /// - public global::DeepInfra.JsonSchemaResponseFormat? Type149 { get; set; } + public global::DeepInfra.MeVercelConnection2? Type185 { get; set; } /// - /// + /// /// - public global::DeepInfra.LogQueryOut? Type150 { get; set; } + public global::DeepInfra.MeIn? Type186 { get; set; } /// - /// + /// /// - public global::DeepInfra.LoraModelUploadIn? Type151 { get; set; } + public global::DeepInfra.ModelDocBlock? Type187 { get; set; } /// - /// + /// /// - public global::DeepInfra.Me? Type152 { get; set; } + public global::DeepInfra.ModelDocBlockKey? Type188 { get; set; } /// - /// + /// /// - public global::DeepInfra.MeVercelConnection2? Type153 { get; set; } + public global::DeepInfra.ModelFamilyOut? Type189 { get; set; } /// - /// + /// /// - public global::DeepInfra.MeIn? Type154 { get; set; } + public global::System.Collections.Generic.IList? Type190 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelDocBlock? Type155 { get; set; } + public global::DeepInfra.PricingPageSectionOut? Type191 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelDocBlockKey? Type156 { get; set; } + public global::System.Collections.Generic.IList? Type192 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelFamilyOut? Type157 { get; set; } + public global::DeepInfra.ModelFieldInfo? Type193 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type158 { get; set; } + public global::DeepInfra.ModelInfoOut? Type194 { get; set; } /// - /// + /// /// - public global::DeepInfra.PricingPageSectionOut? Type159 { get; set; } + public global::System.Collections.Generic.IList? Type195 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type160 { get; set; } + public global::DeepInfra.ModelPricingTime? Type196 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelFieldInfo? Type161 { get; set; } + public global::DeepInfra.ModelPricingUptime? Type197 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelInfoOut? Type162 { get; set; } + public global::DeepInfra.ModelPricingTokens? Type198 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type163 { get; set; } + public global::DeepInfra.ModelPricingInputLength? Type199 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type164 { get; set; } + public global::DeepInfra.ModelPricingInputTokens? Type200 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingTime? Type165 { get; set; } + public global::DeepInfra.ModelPricingInputCharacterLength? Type201 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingUptime? Type166 { get; set; } + public global::DeepInfra.ModelPricingImageUnits? Type202 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingTokens? Type167 { get; set; } + public global::DeepInfra.ModelPricingOutputLength? Type203 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingInputLength? Type168 { get; set; } + public global::DeepInfra.ModelPricingFrameUnits? Type204 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingInputTokens? Type169 { get; set; } + public global::System.Collections.Generic.IList? Type205 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingInputCharacterLength? Type170 { get; set; } + public global::System.Collections.Generic.IList? Type206 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingImageUnits? Type171 { get; set; } + public global::DeepInfra.SchemaVariant? Type207 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPricingOutputLength? Type172 { get; set; } + public global::DeepInfra.ModelMetaIn? Type208 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type173 { get; set; } + public global::DeepInfra.ModelMetadata? Type209 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type174 { get; set; } + public global::System.Collections.Generic.Dictionary? Type210 { get; set; } /// - /// + /// /// - public global::DeepInfra.SchemaVariant? Type175 { get; set; } + public global::DeepInfra.ModelNameSuggestionOut? Type211 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelMetaIn? Type176 { get; set; } + public global::DeepInfra.ModelOut? Type212 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelMetadata? Type177 { get; set; } + public global::DeepInfra.ModelPublicityIn? Type213 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.Dictionary? Type178 { get; set; } + public global::DeepInfra.ModelVersionOut? Type214 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelOut? Type179 { get; set; } + public global::DeepInfra.OpenAIBatchesIn? Type215 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type180 { get; set; } + public global::DeepInfra.OpenAIBatchesInEndpoint? Type216 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelPublicityIn? Type181 { get; set; } + public global::System.Collections.Generic.Dictionary? Type217 { get; set; } /// - /// + /// /// - public global::DeepInfra.ModelVersionOut? Type182 { get; set; } + public global::DeepInfra.OpenAIBatchesOut? Type218 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIBatch? Type183 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsIn? Type219 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIBatchesIn? Type184 { get; set; } + public global::DeepInfra.OneOf? Type220 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIBatchesInEndpoint? Type185 { get; set; } + public global::DeepInfra.AnyOf, object>? Type221 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIChatCompletionsIn? Type186 { get; set; } + public global::System.Collections.Generic.IList? Type222 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList>? Type187 { get; set; } + public global::DeepInfra.AnyOf? Type223 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type188 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsInToolChoice? Type224 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, object>? Type189 { get; set; } + public global::DeepInfra.AnyOf? Type225 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type190 { get; set; } + public global::DeepInfra.TextResponseFormat? Type226 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type191 { get; set; } + public global::DeepInfra.RegexResponseFormat? Type227 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf? Type192 { get; set; } + public global::DeepInfra.StreamOptions? Type228 { get; set; } /// - /// + /// /// - public global::DeepInfra.TextResponseFormat? Type193 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? Type229 { get; set; } /// - /// + /// /// - public global::DeepInfra.RegexResponseFormat? Type194 { get; set; } + public global::DeepInfra.PromptCacheOptions? Type230 { get; set; } /// - /// + /// /// - public global::DeepInfra.StreamOptions? Type195 { get; set; } + public global::DeepInfra.OpenAICompletionsIn? Type231 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? Type196 { get; set; } + public global::DeepInfra.AnyOf>? Type232 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAICompletionsIn? Type197 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsIn? Type233 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf>? Type198 { get; set; } + public global::DeepInfra.AnyOf>>>? Type234 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type199 { get; set; } + public global::System.Collections.Generic.IList>>? Type235 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIEmbeddingsIn? Type200 { get; set; } + public global::DeepInfra.AnyOf>? Type236 { get; set; } /// - /// + /// /// - public global::DeepInfra.ServiceTier? Type201 { get; set; } + public global::System.Collections.Generic.IList? Type237 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, string>? Type202 { get; set; } + public global::DeepInfra.InputVariant2ItemVariant2Item? Type238 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? Type203 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator? Type239 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIImageData? Type204 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? Type240 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIImagesResponseFormat? Type205 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInInputType2? Type241 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIImagesGenerationsIn? Type206 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? Type242 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIImagesOut? Type207 { get; set; } + public global::DeepInfra.OpenAIFile? Type243 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type208 { get; set; } + public global::DeepInfra.OpenAIFilePurpose? Type244 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIModelOut? Type209 { get; set; } + public global::DeepInfra.OpenAIImageData? Type245 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAIModelsOut? Type210 { get; set; } + public global::DeepInfra.OpenAIImagesResponseFormat? Type246 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type211 { get; set; } + public global::DeepInfra.OpenAIImagesGenerationsIn? Type247 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenAITextToSpeechIn? Type212 { get; set; } + public global::DeepInfra.OpenAIImagesOut? Type248 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenRouterDatacenter? Type213 { get; set; } + public global::System.Collections.Generic.IList? Type249 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenRouterModelData? Type214 { get; set; } + public global::DeepInfra.OpenAIModelOut? Type250 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenRouterPricing? Type215 { get; set; } + public global::DeepInfra.OpenAIModelsOut? Type251 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.Dictionary? Type216 { get; set; } + public global::System.Collections.Generic.IList? Type252 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type217 { get; set; } + public global::DeepInfra.OpenAITextToSpeechIn? Type253 { get; set; } /// - /// + /// /// - public global::DeepInfra.OpenRouterModelsOut? Type218 { get; set; } + public global::DeepInfra.OpenClawLaunchTokenOut? Type254 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type219 { get; set; } + public global::DeepInfra.OpenRouterModelsOut? Type255 { get; set; } /// - /// + /// /// - public global::DeepInfra.PricingPageEntryOut? Type220 { get; set; } + public global::DeepInfra.PresetConfigOut? Type256 { get; set; } /// - /// + /// /// - public global::DeepInfra.PricingType? Type221 { get; set; } + public global::DeepInfra.PresetConfigOutStandardArgs? Type257 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type222 { get; set; } + public global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2? Type258 { get; set; } /// - /// + /// /// - public global::DeepInfra.RateLimitOut? Type223 { get; set; } + public global::DeepInfra.PresetConfigOutStandardArgsQuantization2? Type259 { get; set; } /// - /// + /// /// - public global::DeepInfra.RateLimitRequestIn? Type224 { get; set; } + public global::DeepInfra.PricingPageEntryOut? Type260 { get; set; } /// - /// + /// /// - public global::DeepInfra.RequestCostItem? Type225 { get; set; } + public global::DeepInfra.PricingType? Type261 { get; set; } /// - /// + /// /// - public global::DeepInfra.RequestCostQuery? Type226 { get; set; } + public global::System.Collections.Generic.IList? Type262 { get; set; } /// - /// + /// /// - public global::DeepInfra.RequestCostResponse? Type227 { get; set; } + public global::DeepInfra.PromptCacheOptionsMode2? Type263 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type228 { get; set; } + public global::DeepInfra.PromptCacheOptionsTtl2? Type264 { get; set; } /// - /// + /// /// - public global::DeepInfra.SchemaOut? Type229 { get; set; } + public global::DeepInfra.RateLimitOut? Type265 { get; set; } /// - /// + /// /// - public global::DeepInfra.SchemaVariantKey? Type230 { get; set; } + public global::DeepInfra.RateLimitRequestIn? Type266 { get; set; } /// - /// + /// /// - public global::DeepInfra.ScopedJWTIn? Type231 { get; set; } + public global::DeepInfra.RebalanceCancelIn? Type267 { get; set; } /// - /// + /// /// - public global::DeepInfra.ScopedJWTOut? Type232 { get; set; } + public global::DeepInfra.RebalanceCancelOut? Type268 { get; set; } /// - /// + /// /// - public global::DeepInfra.SourceTypeEnum? Type233 { get; set; } + public global::DeepInfra.RebalanceIn? Type269 { get; set; } /// - /// + /// /// - public global::DeepInfra.SshKeyIn? Type234 { get; set; } + public global::DeepInfra.RebalanceOut? Type270 { get; set; } /// - /// + /// /// - public global::DeepInfra.SshKeyOut? Type235 { get; set; } + public global::DeepInfra.RebalanceStatus? Type271 { get; set; } /// - /// + /// /// - public global::DeepInfra.UpdateLoraApiRequest? Type236 { get; set; } + public global::DeepInfra.RebalanceStatusDirection? Type272 { get; set; } /// - /// + /// /// - public global::DeepInfra.WebLiveMetricsOut? Type237 { get; set; } + public global::DeepInfra.RebalanceStatusOut? Type273 { get; set; } /// - /// + /// /// - public global::DeepInfra.ContainerRentalsListV1ContainersGetState? Type238 { get; set; } + public global::System.Collections.Generic.IList? Type274 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type239 { get; set; } + public global::DeepInfra.RequestCostItem? Type275 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type240 { get; set; } + public global::DeepInfra.RequestCostQuery? Type276 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type241 { get; set; } + public global::DeepInfra.RequestCostResponse? Type277 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type242 { get; set; } + public global::System.Collections.Generic.IList? Type278 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type243 { get; set; } + public global::DeepInfra.SandboxCreateIn? Type279 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type244 { get; set; } + public global::DeepInfra.SandboxCreateOut? Type280 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.IList? Type245 { get; set; } + public global::DeepInfra.SandboxExecIn? Type281 { get; set; } + /// + /// + /// + public global::DeepInfra.SandboxOut? Type282 { get; set; } + /// + /// + /// + public global::DeepInfra.SandboxPlanOut? Type283 { get; set; } + /// + /// + /// + public global::DeepInfra.SchemaOut? Type284 { get; set; } + /// + /// + /// + public global::DeepInfra.SchemaVariantKey? Type285 { get; set; } + /// + /// + /// + public global::DeepInfra.ScopedJWTIn? Type286 { get; set; } + /// + /// + /// + public global::DeepInfra.ScopedJWTOut? Type287 { get; set; } + /// + /// + /// + public global::DeepInfra.SourceTypeEnum? Type288 { get; set; } + /// + /// + /// + public global::DeepInfra.SshKeyIn? Type289 { get; set; } + /// + /// + /// + public global::DeepInfra.SshKeyOut? Type290 { get; set; } + /// + /// + /// + public global::DeepInfra.StandardArgsKvCacheDtype2? Type291 { get; set; } + /// + /// + /// + public global::DeepInfra.StandardArgsQuantization2? Type292 { get; set; } + /// + /// + /// + public global::DeepInfra.TokenizeIn? Type293 { get; set; } + /// + /// + /// + public global::DeepInfra.TokenizeOut? Type294 { get; set; } + /// + /// + /// + public global::DeepInfra.UpdateLoraApiRequest? Type295 { get; set; } + /// + /// + /// + public global::DeepInfra.VideoGenerationIn? Type296 { get; set; } + /// + /// + /// + public global::DeepInfra.VideoGenerationOut? Type297 { get; set; } + /// + /// + /// + public global::DeepInfra.WebLiveMetricsOut? Type298 { get; set; } + /// + /// + /// + public global::DeepInfra.WebSearchTool? Type299 { get; set; } + /// + /// + /// + public global::DeepInfra.ContainerRentalsListV1ContainersGetState? Type300 { get; set; } + /// + /// + /// + public global::DeepInfra.OpenclawListV1AgentsGetState? Type301 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type302 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type303 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type304 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type305 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type306 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type307 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type308 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type309 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type310 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type311 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type312 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type313 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type314 { get; set; } /// - /// + /// /// public global::System.Collections.Generic.List? ListType0 { get; set; } /// - /// + /// /// - 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::System.Collections.Generic.List? ListType6 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType7 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::DeepInfra.AnyOf, object>? ListType8 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType10 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, object>? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType12 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType13 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::DeepInfra.AnyOf, object>? ListType14 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf>? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf>>? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List>? ListType17 { get; set; } + public global::DeepInfra.AnyOf>? ListType17 { get; set; } /// - /// + /// /// public global::System.Collections.Generic.List? ListType18 { 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? ListType21 { 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? ListType24 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType25 { 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.Dictionary>? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType28 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType29 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::DeepInfra.AnyOf, object>? ListType30 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType31 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::DeepInfra.AnyOf>? ListType32 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::DeepInfra.AnyOf>>>? ListType33 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List>>? ListType34 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::DeepInfra.AnyOf>? ListType35 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List>? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType36 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, object>? ListType28 { get; set; } + public global::System.Collections.Generic.List? ListType37 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType29 { get; set; } + public global::System.Collections.Generic.List? ListType38 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf>? ListType30 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::System.Collections.Generic.List? ListType40 { get; set; } /// - /// + /// /// - public global::DeepInfra.AnyOf, string>? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType42 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType44 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType36 { get; set; } + public global::System.Collections.Generic.List? ListType45 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType46 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType47 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType48 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType49 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType50 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType51 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType43 { get; set; } + public global::System.Collections.Generic.List? ListType52 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType44 { get; set; } + public global::System.Collections.Generic.List? ListType53 { get; set; } /// - /// + /// /// - public global::System.Collections.Generic.List? ListType45 { get; set; } + public global::System.Collections.Generic.List? ListType54 { 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..e18c67b6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.CreateLora.g.cs @@ -0,0 +1,540 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.CreateLoraApiRequest request); + partial void PrepareCreateLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateLoraAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareCreateLoraArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareCreateLoraRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..911e8712 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLora.g.cs @@ -0,0 +1,485 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeleteLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteLoraAsResponseAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteLoraArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..07924c4f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.DeleteLoraModel.g.cs @@ -0,0 +1,522 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeleteLoraModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraModelName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteLoraModelAsResponseAsync( + loraModelName: loraModelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteLoraModelArguments( + httpClient: HttpClient, + loraModelName: ref loraModelName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..09d13720 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLora.g.cs @@ -0,0 +1,485 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetLoraAsResponseAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetLoraArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..289f84b9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetLoraStatus.g.cs @@ -0,0 +1,485 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetLoraStatusRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetLoraStatusAsResponseAsync( + loraName: loraName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetLoraStatusArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..d260d264 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetModelLoras.g.cs @@ -0,0 +1,485 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetModelLorasRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetModelLorasAsResponseAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetModelLorasArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..a2471693 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.GetUserLoras.g.cs @@ -0,0 +1,476 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetUserLorasRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetUserLorasAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetUserLorasArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..bf371537 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UpdateLora.g.cs @@ -0,0 +1,539 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.UpdateLoraApiRequest request); + partial void PrepareUpdateLoraRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loraName, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateLoraAsResponseAsync( + loraName: loraName, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareUpdateLoraArguments( + httpClient: HttpClient, + loraName: ref loraName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareUpdateLoraRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loraName: loraName!, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..00dc07bd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.UploadLoraModel.g.cs @@ -0,0 +1,574 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.LoraModelUploadIn request); + partial void PrepareUploadLoraModelRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadLoraModelAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareUploadLoraModelArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareUploadLoraModelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..d3f5eb1d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..f03ba1f0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.DeploymentLogsQuery.g.cs @@ -0,0 +1,640 @@ + +#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, + ref string? xApiKey); + 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, + string? xApiKey); + 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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..44313e61 --- /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..311ae732 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetRequestCosts.g.cs @@ -0,0 +1,528 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.RequestCostQuery request); + partial void PrepareGetRequestCostsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRequestCostsAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareGetRequestCostsArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareGetRequestCostsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..b2eee961 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.LogsQuery.g.cs @@ -0,0 +1,626 @@ + +#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, + ref string? xApiKey); + 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, + string? xApiKey); + 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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..a6483db3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.Json.g.cs deleted file mode 100644 index 9fcfdfd6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AccountEmailValuesV1MeEmailsGetXiApiKey - { - /// - /// 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.AccountEmailValuesV1MeEmailsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AccountEmailValuesV1MeEmailsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.AccountEmailValuesV1MeEmailsGetXiApiKey; - } - - /// - /// 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.AccountEmailValuesV1MeEmailsGetXiApiKey? 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.AccountEmailValuesV1MeEmailsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountEmailValuesV1MeEmailsGetXiApiKey; - } - - /// - /// 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.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs deleted file mode 100644 index 897628a3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AccountEmailValuesV1MeEmailsGetXiApiKey - { - - /// - /// 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.AccountGpuLimitV1MeGpuLimitGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.Json.g.cs deleted file mode 100644 index a7620a50..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AccountGpuLimitV1MeGpuLimitGetXiApiKey - { - /// - /// 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.AccountGpuLimitV1MeGpuLimitGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXiApiKey; - } - - /// - /// 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.AccountGpuLimitV1MeGpuLimitGetXiApiKey? 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.AccountGpuLimitV1MeGpuLimitGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXiApiKey; - } - - /// - /// 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.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs deleted file mode 100644 index cced60f7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AccountGpuLimitV1MeGpuLimitGetXiApiKey - { - - /// - /// 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.AccountRateLimitV1MeRateLimitGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.Json.g.cs deleted file mode 100644 index 3c89ec84..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AccountRateLimitV1MeRateLimitGetXiApiKey - { - /// - /// 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.AccountRateLimitV1MeRateLimitGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AccountRateLimitV1MeRateLimitGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.AccountRateLimitV1MeRateLimitGetXiApiKey; - } - - /// - /// 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.AccountRateLimitV1MeRateLimitGetXiApiKey? 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.AccountRateLimitV1MeRateLimitGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountRateLimitV1MeRateLimitGetXiApiKey; - } - - /// - /// 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.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs deleted file mode 100644 index 90a92acb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AccountRateLimitV1MeRateLimitGetXiApiKey - { - - /// - /// 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.AccountUpdateDetailsV1MePatchResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.Json.g.cs index 032777b5..83d7f48b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AccountUpdateDetailsV1MePatchResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountUpdateDetailsV1MePatchResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountUpdateDetailsV1MePatchResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs index c1649d10..866817e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AccountUpdateDetailsV1MePatchResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.Json.g.cs deleted file mode 100644 index 21b3f0c0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AccountUpdateDetailsV1MePatchXiApiKey - { - /// - /// 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.AccountUpdateDetailsV1MePatchXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AccountUpdateDetailsV1MePatchXiApiKey), - jsonSerializerContext) as global::DeepInfra.AccountUpdateDetailsV1MePatchXiApiKey; - } - - /// - /// 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.AccountUpdateDetailsV1MePatchXiApiKey? 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.AccountUpdateDetailsV1MePatchXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountUpdateDetailsV1MePatchXiApiKey; - } - - /// - /// 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.AccountUpdateDetailsV1MePatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs deleted file mode 100644 index ba332eec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AccountUpdateDetailsV1MePatchXiApiKey - { - - /// - /// 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.AddFundsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.Json.g.cs index 7099ee47..a787b81b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AddFundsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AddFundsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs index 807b2d24..210e0252 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AddFundsIn { @@ -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..1d850a5a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.AddFundsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AddFundsOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AddFundsOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..fa011b02 --- /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 Checkout Session 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 Checkout Session 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.Json.g.cs index 246fc47d..a042e99b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AddFundsPaymentFundsPostSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AddFundsPaymentFundsPostSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsPaymentFundsPostSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs index 1dac37c2..138177b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AddFundsPaymentFundsPostSession { @@ -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.AgentBackupOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentBackupOut.Json.g.cs new file mode 100644 index 00000000..263ef962 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentBackupOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentBackupOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentBackupOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentBackupOut), + jsonSerializerContext) as global::DeepInfra.AgentBackupOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentBackupOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentBackupOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentBackupOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentBackupOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentBackupOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentBackupOut.g.cs new file mode 100644 index 00000000..03a35cdd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentBackupOut.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentBackupOut + { + /// + /// + /// + [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 AgentBackupOut( + 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 AgentBackupOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCatalogOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCatalogOut.Json.g.cs new file mode 100644 index 00000000..853b5918 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCatalogOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentCatalogOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentCatalogOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentCatalogOut), + jsonSerializerContext) as global::DeepInfra.AgentCatalogOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentCatalogOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentCatalogOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentCatalogOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentCatalogOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCatalogOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCatalogOut.g.cs new file mode 100644 index 00000000..4fe29f20 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCatalogOut.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 AgentCatalogOut + { + + /// + /// 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.AgentCreateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateIn.Json.g.cs new file mode 100644 index 00000000..67362e0d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentCreateIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentCreateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentCreateIn), + jsonSerializerContext) as global::DeepInfra.AgentCreateIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentCreateIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentCreateIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentCreateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentCreateIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateIn.g.cs new file mode 100644 index 00000000..4ebbc2ed --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateIn.g.cs @@ -0,0 +1,73 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentCreateIn + { + /// + /// 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 AgentCreateIn( + 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 AgentCreateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateOut.Json.g.cs new file mode 100644 index 00000000..9785154a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentCreateOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentCreateOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentCreateOut), + jsonSerializerContext) as global::DeepInfra.AgentCreateOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentCreateOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentCreateOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentCreateOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentCreateOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateOut.g.cs new file mode 100644 index 00000000..c8e61525 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentCreateOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentCreateOut + { + /// + /// 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 AgentCreateOut( + string instanceId) + { + this.InstanceId = instanceId ?? throw new global::System.ArgumentNullException(nameof(instanceId)); + } + + /// + /// Initializes a new instance of the class. + /// + public AgentCreateOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceOut.Json.g.cs new file mode 100644 index 00000000..3eeea7d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentInstanceOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentInstanceOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentInstanceOut), + jsonSerializerContext) as global::DeepInfra.AgentInstanceOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentInstanceOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentInstanceOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentInstanceOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentInstanceOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceOut.g.cs new file mode 100644 index 00000000..194a44c8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceOut.g.cs @@ -0,0 +1,193 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentInstanceOut + { + /// + /// + /// + [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; } + + /// + /// POSIX user the agent runs as inside the VM; also the SSH login user. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ssh_user")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SshUser { 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// POSIX user the agent runs as inside the VM; also the SSH login user. + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentInstanceOut( + string id, + string name, + global::DeepInfra.AgentInstanceState state, + int startTs, + int stateTs, + double pricePerHour, + string region, + int sshPort, + string agentType, + string sshUser, + 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.SshUser = sshUser ?? throw new global::System.ArgumentNullException(nameof(sshUser)); + this.PlanId = planId ?? throw new global::System.ArgumentNullException(nameof(planId)); + } + + /// + /// Initializes a new instance of the class. + /// + public AgentInstanceOut() + { + } + + } +} \ 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..8149e346 --- /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.AgentPlanOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentPlanOut.Json.g.cs new file mode 100644 index 00000000..cd4f73ad --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentPlanOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentPlanOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentPlanOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentPlanOut), + jsonSerializerContext) as global::DeepInfra.AgentPlanOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentPlanOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentPlanOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentPlanOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentPlanOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentPlanOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentPlanOut.g.cs new file mode 100644 index 00000000..2c89dc2a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentPlanOut.g.cs @@ -0,0 +1,95 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentPlanOut + { + /// + /// 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; } + + /// + /// Included monthly egress allowance in GB + /// + [global::System.Text.Json.Serialization.JsonPropertyName("monthly_egress_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MonthlyEgressGb { 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 + /// + /// + /// Included monthly egress allowance in GB + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentPlanOut( + string id, + int vcpu, + int ramGb, + double pricePerHour, + int monthlyEgressGb) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Vcpu = vcpu; + this.RamGb = ramGb; + this.PricePerHour = pricePerHour; + this.MonthlyEgressGb = monthlyEgressGb; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentPlanOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentTypeMetaOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentTypeMetaOut.Json.g.cs new file mode 100644 index 00000000..c539f97d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentTypeMetaOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentTypeMetaOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentTypeMetaOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentTypeMetaOut), + jsonSerializerContext) as global::DeepInfra.AgentTypeMetaOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentTypeMetaOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentTypeMetaOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentTypeMetaOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentTypeMetaOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentTypeMetaOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentTypeMetaOut.g.cs new file mode 100644 index 00000000..7484aa3d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentTypeMetaOut.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentTypeMetaOut + { + /// + /// 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 AgentTypeMetaOut( + 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 AgentTypeMetaOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentUpdateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentUpdateIn.Json.g.cs new file mode 100644 index 00000000..26595fff --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentUpdateIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AgentUpdateIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.AgentUpdateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AgentUpdateIn), + jsonSerializerContext) as global::DeepInfra.AgentUpdateIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AgentUpdateIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.AgentUpdateIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.AgentUpdateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AgentUpdateIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentUpdateIn.g.cs new file mode 100644 index 00000000..ac4f0c92 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentUpdateIn.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AgentUpdateIn + { + /// + /// 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 AgentUpdateIn( + string name) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public AgentUpdateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs deleted file mode 100644 index 872e5f9b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta - { - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta? 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs deleted file mode 100644 index f26abc2d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta - { - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs deleted file mode 100644 index 6e646133..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion - { - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion? 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs deleted file mode 100644 index b0f7439a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion - { - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.Json.g.cs index 7225b645..b14659b3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs index e2d97e40..f2d9314a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesAnthropicV1MessagesPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.Json.g.cs deleted file mode 100644 index 000f53dc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXApiKey - { - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXApiKey), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXApiKey; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXApiKey? 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.AnthropicMessagesAnthropicV1MessagesPostXApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXApiKey; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs deleted file mode 100644 index 4aff8291..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXApiKey - { - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 689995c1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource - { - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource? 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.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource; - } - - /// - /// 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.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs deleted file mode 100644 index d8f498ad..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource - { - - /// - /// 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.Json.g.cs index d2707caa..b9e2ff1f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs index c7b3c386..ee7114f3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.Json.g.cs deleted file mode 100644 index ff157422..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey - { - /// - /// 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey; - } - - /// - /// 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey? 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey; - } - - /// - /// 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs deleted file mode 100644 index ab9f3484..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey - { - - /// - /// 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.AnthropicMessagesIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.Json.g.cs index 675f1ce5..b1f11020 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs index cd1e6852..24ca50eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs @@ -4,39 +4,58 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesIn { /// - /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("fail_fast")] + public bool? FailFast { get; set; } + + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("models")] + public global::System.Collections.Generic.IList? Models { 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("max_tokens")] public int? MaxTokens { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("messages")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Messages { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("system")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>))] public global::DeepInfra.AnyOf, object>? System { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("stop_sequences")] public global::System.Collections.Generic.IList? StopSequences { get; set; } @@ -54,41 +73,47 @@ public sealed partial class AnthropicMessagesIn public double? Temperature { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("top_p")] public double? TopP { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("top_k")] public int? TopK { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] public object? Metadata { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tools")] public global::System.Collections.Generic.IList? Tools { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_choice")] public object? ToolChoice { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("thinking")] public global::DeepInfra.AnthropicThinkingConfig? Thinking { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")] + public string? PromptCacheKey { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -100,6 +125,16 @@ public sealed partial class AnthropicMessagesIn /// /// /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// /// /// /// @@ -115,12 +150,16 @@ public sealed partial class AnthropicMessagesIn /// /// /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public AnthropicMessagesIn( string model, global::System.Collections.Generic.IList messages, + global::DeepInfra.ServiceTier? serviceTier, + bool? failFast, + global::System.Collections.Generic.IList? models, int? maxTokens, global::DeepInfra.AnyOf, object>? system, global::System.Collections.Generic.IList? stopSequences, @@ -131,8 +170,12 @@ public AnthropicMessagesIn( object? metadata, global::System.Collections.Generic.IList? tools, object? toolChoice, - global::DeepInfra.AnthropicThinkingConfig? thinking) + global::DeepInfra.AnthropicThinkingConfig? thinking, + string? promptCacheKey) { + this.ServiceTier = serviceTier; + this.FailFast = failFast; + this.Models = models; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.MaxTokens = maxTokens; this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); @@ -146,6 +189,7 @@ public AnthropicMessagesIn( this.Tools = tools; this.ToolChoice = toolChoice; this.Thinking = thinking; + this.PromptCacheKey = promptCacheKey; } /// @@ -154,5 +198,6 @@ public AnthropicMessagesIn( public AnthropicMessagesIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs deleted file mode 100644 index 8136fb73..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesInMaxTokens - { - /// - /// 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.AnthropicMessagesInMaxTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesInMaxTokens), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInMaxTokens; - } - - /// - /// 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.AnthropicMessagesInMaxTokens? 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.AnthropicMessagesInMaxTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInMaxTokens; - } - - /// - /// 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.AnthropicMessagesInMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs deleted file mode 100644 index f5e8aafe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesInMaxTokens - { - - /// - /// 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.AnthropicMessagesInMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.Json.g.cs index 8b9430ba..a38d1261 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInMessage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs index 90d01510..814a62a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesInMessage { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.Json.g.cs index 42aca38d..b2cac969 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInMetadata; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInMetadata? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInMetadata; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs index 5c310f98..2b173372 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesInMetadata { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.Json.g.cs index d41d6ae2..1cae202d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInMetadata2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInMetadata2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInMetadata2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs index 75310f07..9ab11e43 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesInMetadata2 { @@ -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.AnthropicMessagesInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInServiceTier.g.cs new file mode 100644 index 00000000..5ffd0810 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInServiceTier.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + public sealed partial class AnthropicMessagesInServiceTier + { + + /// + /// 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.AnthropicMessagesInStopSequences.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.Json.g.cs deleted file mode 100644 index e641dacf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesInStopSequences - { - /// - /// 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.AnthropicMessagesInStopSequences? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesInStopSequences), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInStopSequences; - } - - /// - /// 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.AnthropicMessagesInStopSequences? 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.AnthropicMessagesInStopSequences), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInStopSequences; - } - - /// - /// 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.AnthropicMessagesInStopSequences.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs deleted file mode 100644 index 08c0f2dc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesInStopSequences - { - - /// - /// 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.AnthropicMessagesInTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.Json.g.cs deleted file mode 100644 index 867fe894..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesInTemperature - { - /// - /// 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.AnthropicMessagesInTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesInTemperature), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTemperature; - } - - /// - /// 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.AnthropicMessagesInTemperature? 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.AnthropicMessagesInTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTemperature; - } - - /// - /// 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.AnthropicMessagesInTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs deleted file mode 100644 index e3bb5f93..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 1F - /// - public sealed partial class AnthropicMessagesInTemperature - { - - /// - /// 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.AnthropicMessagesInThinking.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.Json.g.cs index 1cfbd3cb..dc0ae88e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInThinking; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInThinking? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInThinking; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs index fa8f0067..55f98e02 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesInThinking { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.Json.g.cs index e1f1e441..e53c8c4c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInToolChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInToolChoice? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInToolChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs index c9faa950..e838a2d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesInToolChoice { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.Json.g.cs index 313c0971..9d573c60 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInToolChoice2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInToolChoice2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInToolChoice2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs index 9782c779..ec33dc8e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicMessagesInToolChoice2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.Json.g.cs deleted file mode 100644 index 56f86bb5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesInTools - { - /// - /// 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.AnthropicMessagesInTools? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesInTools), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTools; - } - - /// - /// 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.AnthropicMessagesInTools? 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.AnthropicMessagesInTools), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTools; - } - - /// - /// 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.AnthropicMessagesInTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs deleted file mode 100644 index da4111cd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesInTools - { - - /// - /// 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.AnthropicMessagesInTopK.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.Json.g.cs deleted file mode 100644 index 1ebbac2f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesInTopK - { - /// - /// 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.AnthropicMessagesInTopK? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesInTopK), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTopK; - } - - /// - /// 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.AnthropicMessagesInTopK? 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.AnthropicMessagesInTopK), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTopK; - } - - /// - /// 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.AnthropicMessagesInTopK.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs deleted file mode 100644 index 69183ce5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesInTopK - { - - /// - /// 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.AnthropicMessagesInTopP.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.Json.g.cs deleted file mode 100644 index bde161e5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicMessagesInTopP - { - /// - /// 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.AnthropicMessagesInTopP? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicMessagesInTopP), - jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTopP; - } - - /// - /// 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.AnthropicMessagesInTopP? 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.AnthropicMessagesInTopP), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTopP; - } - - /// - /// 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.AnthropicMessagesInTopP.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs deleted file mode 100644 index d91780ed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicMessagesInTopP - { - - /// - /// 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.AnthropicSystemContent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.Json.g.cs index a8d25019..40f3ade0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicSystemContent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicSystemContent? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicSystemContent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs index a682bc4f..bdc99266 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicSystemContent { /// - /// + /// /// /// "text" [global::System.Text.Json.Serialization.JsonPropertyName("type")] public string Type { get; set; } = "text"; /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("text")] [global::System.Text.Json.Serialization.JsonRequired] @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.Json.g.cs index 998dac2f..e3574127 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicThinkingConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicThinkingConfig? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicThinkingConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs index 8c801067..0baae0eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs @@ -4,12 +4,26 @@ namespace DeepInfra { /// - /// + /// Anthropic `thinking` config: {type: enabled|disabled|adaptive, budget_tokens}.
+ /// `enabled` is a legacy pre-spec field this endpoint used to accept; it only
+ /// applies when `type` is absent. ///
public sealed partial class AnthropicThinkingConfig { /// - /// Default Value: true + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public global::DeepInfra.AnthropicThinkingConfigType2? Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("budget_tokens")] + public int? BudgetTokens { get; set; } + + /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("enabled")] public bool? Enabled { get; set; } @@ -23,15 +37,19 @@ public sealed partial class AnthropicThinkingConfig /// /// Initializes a new instance of the class. /// - /// - /// Default Value: true - /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public AnthropicThinkingConfig( + global::DeepInfra.AnthropicThinkingConfigType2? type, + int? budgetTokens, bool? enabled) { + this.Type = type; + this.BudgetTokens = budgetTokens; this.Enabled = enabled; } @@ -41,5 +59,6 @@ public AnthropicThinkingConfig( public AnthropicThinkingConfig() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfigType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfigType.g.cs new file mode 100644 index 00000000..e2fa1bd0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfigType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AnthropicThinkingConfigType + { + + /// + /// 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.AnthropicThinkingConfigType2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfigType2.g.cs new file mode 100644 index 00000000..f05d2f76 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfigType2.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum AnthropicThinkingConfigType2 + { + /// + /// + /// + Adaptive, + /// + /// + /// + Disabled, + /// + /// + /// + Enabled, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AnthropicThinkingConfigType2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AnthropicThinkingConfigType2 value) + { + return value switch + { + AnthropicThinkingConfigType2.Adaptive => "adaptive", + AnthropicThinkingConfigType2.Disabled => "disabled", + AnthropicThinkingConfigType2.Enabled => "enabled", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AnthropicThinkingConfigType2? ToEnum(string value) + { + return value switch + { + "adaptive" => AnthropicThinkingConfigType2.Adaptive, + "disabled" => AnthropicThinkingConfigType2.Disabled, + "enabled" => AnthropicThinkingConfigType2.Enabled, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.Json.g.cs index 95ff2b97..89b64c57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTokenCountRequest? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs index a88bca78..ab2bbc66 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs @@ -4,45 +4,45 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicTokenCountRequest { /// - /// + /// /// [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("messages")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Messages { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("system")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>))] public global::DeepInfra.AnyOf, object>? System { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tools")] public global::System.Collections.Generic.IList? Tools { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("thinking")] public global::DeepInfra.AnthropicThinkingConfig? Thinking { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_choice")] public object? ToolChoice { get; set; } @@ -87,5 +87,6 @@ public AnthropicTokenCountRequest( public AnthropicTokenCountRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.Json.g.cs index c83deb02..7615f191 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequestMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTokenCountRequestMessage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequestMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs index d4e3cc59..e8b9bb10 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicTokenCountRequestMessage { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.Json.g.cs index e745dcf7..08973489 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequestThinking; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTokenCountRequestThinking? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequestThinking; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs index dad0cc17..90632276 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicTokenCountRequestThinking { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.Json.g.cs index a469061e..e5e22796 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequestToolChoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTokenCountRequestToolChoice? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequestToolChoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs index 60e1a7f0..d9a073de 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicTokenCountRequestToolChoice { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.Json.g.cs index 6a529f58..a867f97a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequestToolChoice2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTokenCountRequestToolChoice2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequestToolChoice2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs index 2beeeb4d..555fe0be 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicTokenCountRequestToolChoice2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.Json.g.cs deleted file mode 100644 index 056683ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicTokenCountRequestTools - { - /// - /// 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.AnthropicTokenCountRequestTools? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicTokenCountRequestTools), - jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequestTools; - } - - /// - /// 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.AnthropicTokenCountRequestTools? 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.AnthropicTokenCountRequestTools), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequestTools; - } - - /// - /// 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.AnthropicTokenCountRequestTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs deleted file mode 100644 index 47bf2e1e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicTokenCountRequestTools - { - - /// - /// 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.AnthropicTool.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.Json.g.cs index f2e20290..69e39ac0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTool; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTool? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTool; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs index c809bd10..8cb556e1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs @@ -4,25 +4,25 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicTool { /// - /// + /// /// [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("description")] public string? Description { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("input_schema")] [global::System.Text.Json.Serialization.JsonRequired] @@ -59,5 +59,6 @@ public AnthropicTool( public AnthropicTool() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs deleted file mode 100644 index 176a3a80..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AnthropicToolDescription - { - /// - /// 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.AnthropicToolDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnthropicToolDescription), - jsonSerializerContext) as global::DeepInfra.AnthropicToolDescription; - } - - /// - /// 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.AnthropicToolDescription? 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.AnthropicToolDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicToolDescription; - } - - /// - /// 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.AnthropicToolDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs deleted file mode 100644 index d9ad7a8b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AnthropicToolDescription - { - - /// - /// 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.AnthropicToolInputSchema.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.Json.g.cs index 187c5537..e32779c0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicToolInputSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicToolInputSchema? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicToolInputSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs index 9ab90616..6731176f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class AnthropicToolInputSchema { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.Json.g.cs index ddbdf50d..38f1cb47 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ApiToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ApiToken? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs index eb7838b2..fac50edb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ApiToken { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("token")] [global::System.Text.Json.Serialization.JsonRequired] @@ -24,20 +24,20 @@ public sealed partial class ApiToken public required global::System.DateTimeOffset CreatedAt { 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("token_id")] public string? TokenId { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("allowed_ips")] public global::System.Collections.Generic.IList? AllowedIps { get; set; } @@ -81,5 +81,6 @@ public ApiToken( public ApiToken() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs deleted file mode 100644 index a68220b6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ApiTokenAllowedIps - { - /// - /// 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.ApiTokenAllowedIps? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ApiTokenAllowedIps), - jsonSerializerContext) as global::DeepInfra.ApiTokenAllowedIps; - } - - /// - /// 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.ApiTokenAllowedIps? 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.ApiTokenAllowedIps), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiTokenAllowedIps; - } - - /// - /// 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.ApiTokenAllowedIps.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs deleted file mode 100644 index 14d823cc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ApiTokenAllowedIps - { - - /// - /// 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.ApiTokenIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.Json.g.cs index 10f5f029..e4dba322 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ApiTokenIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ApiTokenIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiTokenIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs index 94364ed7..03d1c4d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ApiTokenIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonRequired] @@ -40,5 +40,6 @@ public ApiTokenIn( public ApiTokenIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs deleted file mode 100644 index c2469a3c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ApiTokenTokenId - { - /// - /// 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.ApiTokenTokenId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ApiTokenTokenId), - jsonSerializerContext) as global::DeepInfra.ApiTokenTokenId; - } - - /// - /// 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.ApiTokenTokenId? 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.ApiTokenTokenId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiTokenTokenId; - } - - /// - /// 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.ApiTokenTokenId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs deleted file mode 100644 index cc96cf6d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ApiTokenTokenId - { - - /// - /// 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.ApiTokenVercelExportIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.Json.g.cs index 1174fcd4..6855e421 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ApiTokenVercelExportIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ApiTokenVercelExportIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiTokenVercelExportIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs index f8b5ccd2..943b1c5e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs @@ -4,40 +4,40 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ApiTokenVercelExportIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("project_id_or_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string ProjectIdOrName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("is_sensitive")] [global::System.Text.Json.Serialization.JsonRequired] public required bool IsSensitive { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("env_development")] [global::System.Text.Json.Serialization.JsonRequired] public required bool EnvDevelopment { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("env_preview")] [global::System.Text.Json.Serialization.JsonRequired] public required bool EnvPreview { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("env_production")] [global::System.Text.Json.Serialization.JsonRequired] @@ -80,5 +80,6 @@ public ApiTokenVercelExportIn( public ApiTokenVercelExportIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorData.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorData.Json.g.cs new file mode 100644 index 00000000..8481ccff --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchErrorData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrorData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchErrorData), + jsonSerializerContext) as global::DeepInfra.BatchErrorData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrorData? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchErrorData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchErrorData), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchErrorData; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorData.g.cs new file mode 100644 index 00000000..9d3e4257 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorData.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchErrorData + { + /// + /// An error code identifying the error type. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// The line number of the input file where the error occurred. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("line")] + public int? Line { get; set; } + + /// + /// A human-readable message describing the error. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// The name of the parameter that caused the error. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("param")] + public string? Param { 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. + /// + /// + /// An error code identifying the error type. + /// + /// + /// The line number of the input file where the error occurred. + /// + /// + /// A human-readable message describing the error. + /// + /// + /// The name of the parameter that caused the error. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchErrorData( + string? code, + int? line, + string? message, + string? param) + { + this.Code = code; + this.Line = line; + this.Message = message; + this.Param = param; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchErrorData() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrors.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrors.Json.g.cs new file mode 100644 index 00000000..b6bcf179 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrors.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchErrors + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrors? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchErrors), + jsonSerializerContext) as global::DeepInfra.BatchErrors; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrors? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchErrors? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchErrors), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchErrors; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrors.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrors.g.cs new file mode 100644 index 00000000..8694b9ee --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrors.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchErrors + { + /// + /// The object type, which is always list.
+ /// Default Value: list + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string? Object { get; set; } + + /// + /// List of error objects. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public global::System.Collections.Generic.IList? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The object type, which is always list.
+ /// Default Value: list + /// + /// + /// List of error objects. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchErrors( + string? @object, + global::System.Collections.Generic.IList? data) + { + this.Object = @object; + this.Data = data; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchErrors() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchInputTokensDetails.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchInputTokensDetails.Json.g.cs new file mode 100644 index 00000000..5b430be8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchInputTokensDetails.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchInputTokensDetails + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchInputTokensDetails? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchInputTokensDetails), + jsonSerializerContext) as global::DeepInfra.BatchInputTokensDetails; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchInputTokensDetails? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchInputTokensDetails? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchInputTokensDetails), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchInputTokensDetails; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchInputTokensDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchInputTokensDetails.g.cs new file mode 100644 index 00000000..6ade1940 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchInputTokensDetails.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchInputTokensDetails + { + /// + /// Default Value: 0 + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cached_tokens")] + public int? CachedTokens { 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: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchInputTokensDetails( + int? cachedTokens) + { + this.CachedTokens = cachedTokens; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchInputTokensDetails() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputExpiresAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputExpiresAfter.Json.g.cs new file mode 100644 index 00000000..1995716d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputExpiresAfter.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchOutputExpiresAfter + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchOutputExpiresAfter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchOutputExpiresAfter), + jsonSerializerContext) as global::DeepInfra.BatchOutputExpiresAfter; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchOutputExpiresAfter? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchOutputExpiresAfter? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchOutputExpiresAfter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchOutputExpiresAfter; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputExpiresAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputExpiresAfter.g.cs new file mode 100644 index 00000000..167e929b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputExpiresAfter.g.cs @@ -0,0 +1,61 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchOutputExpiresAfter + { + /// + /// The anchor timestamp after which the expiration policy applies. Currently only created_at is supported.
+ /// Default Value: created_at + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("anchor")] + public string? Anchor { get; set; } + + /// + /// The number of seconds after the anchor time that the output and error files will expire. Must be between 3600 (1 hour) and 2592000 (30 days).
+ /// Default Value: 2592000 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("seconds")] + public int? Seconds { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The anchor timestamp after which the expiration policy applies. Currently only created_at is supported.
+ /// Default Value: created_at + /// + /// + /// The number of seconds after the anchor time that the output and error files will expire. Must be between 3600 (1 hour) and 2592000 (30 days).
+ /// Default Value: 2592000 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchOutputExpiresAfter( + string? anchor, + int? seconds) + { + this.Anchor = anchor; + this.Seconds = seconds; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchOutputExpiresAfter() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputTokensDetails.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputTokensDetails.Json.g.cs new file mode 100644 index 00000000..1d481e7b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputTokensDetails.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchOutputTokensDetails + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchOutputTokensDetails? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchOutputTokensDetails), + jsonSerializerContext) as global::DeepInfra.BatchOutputTokensDetails; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchOutputTokensDetails? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchOutputTokensDetails? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchOutputTokensDetails), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchOutputTokensDetails; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputTokensDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputTokensDetails.g.cs new file mode 100644 index 00000000..4c89b578 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchOutputTokensDetails.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchOutputTokensDetails + { + /// + /// Default Value: 0 + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reasoning_tokens")] + public int? ReasoningTokens { 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: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchOutputTokensDetails( + int? reasoningTokens) + { + this.ReasoningTokens = reasoningTokens; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchOutputTokensDetails() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchRequestCounts.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchRequestCounts.Json.g.cs new file mode 100644 index 00000000..abef6eef --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchRequestCounts.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchRequestCounts + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchRequestCounts? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchRequestCounts), + jsonSerializerContext) as global::DeepInfra.BatchRequestCounts; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchRequestCounts? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchRequestCounts? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchRequestCounts), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchRequestCounts; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchRequestCounts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchRequestCounts.g.cs new file mode 100644 index 00000000..f443d9bb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchRequestCounts.g.cs @@ -0,0 +1,74 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchRequestCounts + { + /// + /// Total number of requests in the batch.
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("total")] + public int? Total { get; set; } + + /// + /// Number of requests that completed successfully.
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("completed")] + public int? Completed { get; set; } + + /// + /// Number of requests that failed.
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("failed")] + public int? Failed { 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. + /// + /// + /// Total number of requests in the batch.
+ /// Default Value: 0 + /// + /// + /// Number of requests that completed successfully.
+ /// Default Value: 0 + /// + /// + /// Number of requests that failed.
+ /// Default Value: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchRequestCounts( + int? total, + int? completed, + int? failed) + { + this.Total = total; + this.Completed = completed; + this.Failed = failed; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchRequestCounts() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchUsage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchUsage.Json.g.cs new file mode 100644 index 00000000..a25597e8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchUsage.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchUsage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BatchUsage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchUsage), + jsonSerializerContext) as global::DeepInfra.BatchUsage; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchUsage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BatchUsage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BatchUsage), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchUsage; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchUsage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchUsage.g.cs new file mode 100644 index 00000000..591fa53c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchUsage.g.cs @@ -0,0 +1,86 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BatchUsage + { + /// + /// Default Value: 0 + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens")] + public int? InputTokens { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_tokens_details")] + public global::DeepInfra.BatchInputTokensDetails? InputTokensDetails { get; set; } + + /// + /// Default Value: 0 + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_tokens")] + public int? OutputTokens { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_tokens_details")] + public global::DeepInfra.BatchOutputTokensDetails? OutputTokensDetails { get; set; } + + /// + /// Default Value: 0 + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total_tokens")] + public int? TotalTokens { 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: 0 + /// + /// + /// + /// Default Value: 0 + /// + /// + /// + /// Default Value: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BatchUsage( + int? inputTokens, + global::DeepInfra.BatchInputTokensDetails? inputTokensDetails, + int? outputTokens, + global::DeepInfra.BatchOutputTokensDetails? outputTokensDetails, + int? totalTokens) + { + this.InputTokens = inputTokens; + this.InputTokensDetails = inputTokensDetails; + this.OutputTokens = outputTokens; + this.OutputTokensDetails = outputTokensDetails; + this.TotalTokens = totalTokens; + } + + /// + /// Initializes a new instance of the class. + /// + public BatchUsage() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOut.Json.g.cs new file mode 100644 index 00000000..7bc8fb97 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOut), + jsonSerializerContext) as global::DeepInfra.BillingAddressOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.BillingAddressOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.BillingAddressOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOut.g.cs new file mode 100644 index 00000000..ec0501a6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOut.g.cs @@ -0,0 +1,98 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOut + { + /// + /// + /// + [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 BillingAddressOut( + 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 BillingAddressOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.Json.g.cs index 8e9a156e..7fdd6b39 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BillingPortalOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingPortalOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingPortalOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs index 22ea0d39..18feef71 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BillingPortalOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] [global::System.Text.Json.Serialization.JsonRequired] @@ -40,5 +40,6 @@ public BillingPortalOut( public BillingPortalOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs deleted file mode 100644 index cf07f584..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BillingPortalPaymentBillingPortalGetReturnUrl - { - /// - /// 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.BillingPortalPaymentBillingPortalGetReturnUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BillingPortalPaymentBillingPortalGetReturnUrl), - jsonSerializerContext) as global::DeepInfra.BillingPortalPaymentBillingPortalGetReturnUrl; - } - - /// - /// 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.BillingPortalPaymentBillingPortalGetReturnUrl? 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.BillingPortalPaymentBillingPortalGetReturnUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingPortalPaymentBillingPortalGetReturnUrl; - } - - /// - /// 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.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs deleted file mode 100644 index 71441528..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BillingPortalPaymentBillingPortalGetReturnUrl - { - - /// - /// 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.BillingPortalPaymentBillingPortalGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.Json.g.cs index ba9a0b9e..5bd4bb0c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BillingPortalPaymentBillingPortalGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingPortalPaymentBillingPortalGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingPortalPaymentBillingPortalGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs index fc747f81..207889e1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BillingPortalPaymentBillingPortalGetSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.Json.g.cs index fe704984..24fada68 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyCreateVoiceV1VoicesAddPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyCreateVoiceV1VoicesAddPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs index a2c16cbc..61b064c8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs @@ -4,26 +4,26 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyCreateVoiceV1VoicesAddPost { /// - /// + /// /// [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("description")] [global::System.Text.Json.Serialization.JsonRequired] public required string Description { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("files")] [global::System.Text.Json.Serialization.JsonRequired] @@ -60,5 +60,6 @@ public BodyCreateVoiceV1VoicesAddPost( public BodyCreateVoiceV1VoicesAddPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.Json.g.cs index 96ae1a8f..01688b42 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs index c09b6efd..706e9876 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs @@ -4,39 +4,39 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost { /// - /// + /// /// [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; } @@ -54,11 +54,17 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo public double? Temperature { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("timestamp_granularities")] public global::System.Collections.Generic.IList? TimestampGranularities { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public string? ServiceTier { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -80,6 +86,7 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// Default Value: 0 /// /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -91,7 +98,8 @@ public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost( string? prompt, global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat, double? temperature, - global::System.Collections.Generic.IList? timestampGranularities) + global::System.Collections.Generic.IList? timestampGranularities, + string? serviceTier) { this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); @@ -101,6 +109,7 @@ public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost( this.ResponseFormat = responseFormat; this.Temperature = temperature; this.TimestampGranularities = timestampGranularities; + this.ServiceTier = serviceTier; } /// @@ -109,5 +118,6 @@ public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost( public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs deleted file mode 100644 index 593529ae..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage - { - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage? 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs deleted file mode 100644 index 4cebfbc2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage - { - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs deleted file mode 100644 index 0394a494..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt - { - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt? 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs deleted file mode 100644 index 1d16811c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt - { - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs deleted file mode 100644 index adaf5a05..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat - { - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat? 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat; - } - - /// - /// 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.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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs index 679152b6..9f1f9273 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2.g.cs @@ -4,28 +4,28 @@ namespace DeepInfra { /// - /// + /// /// public enum BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2 { /// - /// + /// /// Json, /// - /// + /// /// Srt, /// - /// + /// /// Text, /// - /// + /// /// VerboseJson, /// - /// + /// /// Vtt, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs deleted file mode 100644 index 397d33e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature - { - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature? 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs deleted file mode 100644 index bfd9426a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 0 - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature - { - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs deleted file mode 100644 index b1bfd743..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities - { - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities? 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities; - } - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs deleted file mode 100644 index 86389fca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities - { - - /// - /// 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs index 69cd65c5..c0595ee7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs @@ -4,16 +4,16 @@ namespace DeepInfra { /// - /// + /// /// public enum BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item { /// - /// + /// /// Segment, /// - /// + /// /// Word, } 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.Json.g.cs index dfffdf20..42d61f1e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs index d05def67..6fb44395 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs @@ -4,33 +4,33 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPost { /// - /// + /// /// [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; } @@ -47,6 +47,12 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPost [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] public double? Temperature { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public string? ServiceTier { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -66,6 +72,7 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPost /// /// Default Value: 0 /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -75,7 +82,8 @@ public BodyOpenaiAudioTranslationsV1AudioTranslationsPost( string model, string? prompt, global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat, - double? temperature) + double? temperature, + string? serviceTier) { this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); @@ -83,6 +91,7 @@ public BodyOpenaiAudioTranslationsV1AudioTranslationsPost( this.Prompt = prompt; this.ResponseFormat = responseFormat; this.Temperature = temperature; + this.ServiceTier = serviceTier; } /// @@ -91,5 +100,6 @@ public BodyOpenaiAudioTranslationsV1AudioTranslationsPost( public BodyOpenaiAudioTranslationsV1AudioTranslationsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs deleted file mode 100644 index 6beffaa5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt - { - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt; - } - - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt? 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt; - } - - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs deleted file mode 100644 index d57b2e35..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt - { - - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs deleted file mode 100644 index e821bb43..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat - { - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat; - } - - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat? 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat; - } - - /// - /// 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.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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs index 0c63b445..76dc9cc4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2.g.cs @@ -4,28 +4,28 @@ namespace DeepInfra { /// - /// + /// /// public enum BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2 { /// - /// + /// /// Json, /// - /// + /// /// Srt, /// - /// + /// /// Text, /// - /// + /// /// VerboseJson, /// - /// + /// /// Vtt, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs deleted file mode 100644 index b2d3cab0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature - { - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature; - } - - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature? 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature; - } - - /// - /// 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs deleted file mode 100644 index 0b2160b9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 0 - /// - public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.Json.g.cs index 9ecfa69e..6467091e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiFilesV1FilesPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiFilesV1FilesPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiFilesV1FilesPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs index c7c7acb7..72c75c04 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiFilesV1FilesPost { /// - /// + /// /// [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] @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.Json.g.cs index 255454f1..0c70962c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs index e4a3e97b..1744d347 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs @@ -4,39 +4,39 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiImagesEditsV1ImagesEditsPost { /// - /// + /// /// [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] @@ -79,5 +79,6 @@ public BodyOpenaiImagesEditsV1ImagesEditsPost( public BodyOpenaiImagesEditsV1ImagesEditsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.Json.g.cs index e8cb215a..7b5618cf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPostInp; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPostInp? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPostInp; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs index f0f5dbbf..a77c57e1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiImagesEditsV1ImagesEditsPostInp { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.Json.g.cs index f6d9ed83..5c2772c1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs index 3b42d8dd..6a01d0de 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs @@ -4,32 +4,32 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiImagesVariationsV1ImagesVariationsPost { /// - /// + /// /// [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] @@ -69,5 +69,6 @@ public BodyOpenaiImagesVariationsV1ImagesVariationsPost( public BodyOpenaiImagesVariationsV1ImagesVariationsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.Json.g.cs index 766ca0a1..779c4690 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs index a9a52231..fa76c591 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyOpenaiImagesVariationsV1ImagesVariationsPostInp { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.Json.g.cs index 7b1dfbcb..9311b860 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs index bf273e21..0f728c75 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class BodyUpdateVoiceV1VoicesVoiceIdEditPost { /// - /// + /// /// [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("description")] [global::System.Text.Json.Serialization.JsonRequired] @@ -50,5 +50,6 @@ public BodyUpdateVoiceV1VoicesVoiceIdEditPost( public BodyUpdateVoiceV1VoicesVoiceIdEditPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.Json.g.cs index 6f6de9c8..a575a6c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionAssistantMessage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs index 42277b8a..71b411e4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionAssistantMessage { @@ -35,7 +35,7 @@ public sealed partial class ChatCompletionAssistantMessage public string? ReasoningContent { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { get; set; } @@ -97,5 +97,6 @@ public ChatCompletionAssistantMessage( public ChatCompletionAssistantMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.Json.g.cs index 65111282..461bc3b3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageCacheControl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionAssistantMessageCacheControl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageCacheControl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.Json.g.cs index 88b5fd45..65c45c1e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageCacheControl2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionAssistantMessageCacheControl2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageCacheControl2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs index 66c9ad76..3e5afeee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionAssistantMessageCacheControl2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.Json.g.cs deleted file mode 100644 index 3dc16a4b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatCompletionAssistantMessageName - { - /// - /// 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.ChatCompletionAssistantMessageName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatCompletionAssistantMessageName), - jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageName; - } - - /// - /// 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.ChatCompletionAssistantMessageName? 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.ChatCompletionAssistantMessageName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageName; - } - - /// - /// 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.ChatCompletionAssistantMessageName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs deleted file mode 100644 index 4f925db1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ChatCompletionAssistantMessageName - { - - /// - /// 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.ChatCompletionAssistantMessageReasoningContent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.Json.g.cs deleted file mode 100644 index 03e4239f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatCompletionAssistantMessageReasoningContent - { - /// - /// 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.ChatCompletionAssistantMessageReasoningContent? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatCompletionAssistantMessageReasoningContent), - jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageReasoningContent; - } - - /// - /// 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.ChatCompletionAssistantMessageReasoningContent? 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.ChatCompletionAssistantMessageReasoningContent), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageReasoningContent; - } - - /// - /// 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.ChatCompletionAssistantMessageReasoningContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs deleted file mode 100644 index e17d7fed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// the reasoning content - /// - public sealed partial class ChatCompletionAssistantMessageReasoningContent - { - - /// - /// 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.ChatCompletionAssistantMessageToolCalls.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.Json.g.cs deleted file mode 100644 index 1b073b98..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatCompletionAssistantMessageToolCalls - { - /// - /// 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.ChatCompletionAssistantMessageToolCalls? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatCompletionAssistantMessageToolCalls), - jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageToolCalls; - } - - /// - /// 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.ChatCompletionAssistantMessageToolCalls? 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.ChatCompletionAssistantMessageToolCalls), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageToolCalls; - } - - /// - /// 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.ChatCompletionAssistantMessageToolCalls.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs deleted file mode 100644 index 78b41ed8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// the tool calls generated by the mode - /// - public sealed partial class ChatCompletionAssistantMessageToolCalls - { - - /// - /// 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.ChatCompletionContentPartAudio.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.Json.g.cs index 1d5af80a..c702041b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionContentPartAudio; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartAudio? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionContentPartAudio; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs index a7c05e81..863f02ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionContentPartAudio { /// - /// + /// /// /// "input_audio" [global::System.Text.Json.Serialization.JsonPropertyName("type")] public string Type { get; set; } = "input_audio"; /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("input_audio")] [global::System.Text.Json.Serialization.JsonRequired] @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.Json.g.cs index 395bba8f..79399df0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionContentPartImage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartImage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionContentPartImage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs index 7247deb2..3d7d57e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionContentPartImage { /// - /// + /// /// /// "image_url" [global::System.Text.Json.Serialization.JsonPropertyName("type")] public string Type { get; set; } = "image_url"; /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("image_url")] [global::System.Text.Json.Serialization.JsonRequired] @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.Json.g.cs index da5c1507..852c2250 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionContentPartText; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartText? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionContentPartText; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs index cc286222..6b2c4f39 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs @@ -4,24 +4,30 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionContentPartText { /// - /// + /// /// /// "text" [global::System.Text.Json.Serialization.JsonPropertyName("type")] public string Type { get; set; } = "text"; /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("text")] [global::System.Text.Json.Serialization.JsonRequired] public required string Text { get; set; } + /// + /// Marks the end of the prefix that prompt_cache_options retention applies to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_breakpoint")] + public global::DeepInfra.PromptCacheBreakpoint? PromptCacheBreakpoint { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -32,16 +38,21 @@ public sealed partial class ChatCompletionContentPartText /// Initializes a new instance of the class. /// /// + /// + /// Marks the end of the prefix that prompt_cache_options retention applies to. + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ChatCompletionContentPartText( string text, + global::DeepInfra.PromptCacheBreakpoint? promptCacheBreakpoint, string type = "text") { this.Type = type; this.Text = text ?? throw new global::System.ArgumentNullException(nameof(text)); + this.PromptCacheBreakpoint = promptCacheBreakpoint; } /// @@ -50,5 +61,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.ChatCompletionContentPartTextPromptCacheBreakpoint.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartTextPromptCacheBreakpoint.Json.g.cs new file mode 100644 index 00000000..19f325b9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartTextPromptCacheBreakpoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChatCompletionContentPartTextPromptCacheBreakpoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint), + jsonSerializerContext) as global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionContentPartTextPromptCacheBreakpoint; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartTextPromptCacheBreakpoint.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartTextPromptCacheBreakpoint.g.cs new file mode 100644 index 00000000..873cc0e4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartTextPromptCacheBreakpoint.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Marks the end of the prefix that prompt_cache_options retention applies to. + /// + public sealed partial class ChatCompletionContentPartTextPromptCacheBreakpoint + { + + /// + /// 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.ChatCompletionContentPartVideo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs new file mode 100644 index 00000000..3e4b358a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionContentPartVideo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ChatCompletionContentPartVideo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ChatCompletionContentPartVideo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionContentPartVideo; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..682f1f79 --- /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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.Json.g.cs index 6fea52e7..fe9f822c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionMessageToolCall; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionMessageToolCall? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionMessageToolCall; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs index d9a9f0fa..4289e6a4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionMessageToolCall { @@ -66,5 +66,6 @@ public ChatCompletionMessageToolCall( public ChatCompletionMessageToolCall() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.Json.g.cs index 4655ed26..35ac19fc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionSystemMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionSystemMessage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionSystemMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs index edf202da..1b301fee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionSystemMessage { @@ -30,7 +30,7 @@ public sealed partial class ChatCompletionSystemMessage public required global::DeepInfra.AnyOf> Content { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { get; set; } @@ -76,5 +76,6 @@ public ChatCompletionSystemMessage( public ChatCompletionSystemMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.Json.g.cs index 906df102..62c3b3e3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionSystemMessageCacheControl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionSystemMessageCacheControl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionSystemMessageCacheControl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.Json.g.cs index a1573c80..bab434f7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionSystemMessageCacheControl2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionSystemMessageCacheControl2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionSystemMessageCacheControl2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs index 4bc8ace1..7a02f22f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionSystemMessageCacheControl2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.Json.g.cs deleted file mode 100644 index b94d5b87..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatCompletionSystemMessageName - { - /// - /// 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.ChatCompletionSystemMessageName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatCompletionSystemMessageName), - jsonSerializerContext) as global::DeepInfra.ChatCompletionSystemMessageName; - } - - /// - /// 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.ChatCompletionSystemMessageName? 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.ChatCompletionSystemMessageName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionSystemMessageName; - } - - /// - /// 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.ChatCompletionSystemMessageName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs deleted file mode 100644 index b5c099f4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ChatCompletionSystemMessageName - { - - /// - /// 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.ChatCompletionToolMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.Json.g.cs index 86bc6b89..105e2986 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionToolMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionToolMessage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionToolMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs index 0527c62e..d3715261 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionToolMessage { @@ -30,7 +30,7 @@ public sealed partial class ChatCompletionToolMessage public required global::DeepInfra.AnyOf> Content { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_call_id")] [global::System.Text.Json.Serialization.JsonRequired] @@ -77,5 +77,6 @@ public ChatCompletionToolMessage( public ChatCompletionToolMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.Json.g.cs index 48ce651d..31bc9b0b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionToolMessageCacheControl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionToolMessageCacheControl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionToolMessageCacheControl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.Json.g.cs index 4a20e60b..eb81889a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionToolMessageCacheControl2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionToolMessageCacheControl2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionToolMessageCacheControl2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs index e2cf6f1d..4efe23f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionToolMessageCacheControl2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.Json.g.cs index 15225793..2de05f6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionUserMessage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionUserMessage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionUserMessage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs index 131c961a..37a0f60b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionUserMessage { @@ -25,12 +25,12 @@ 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; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] public string? Name { 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.Json.g.cs index 435da328..7c1616f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionUserMessageCacheControl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionUserMessageCacheControl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionUserMessageCacheControl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.Json.g.cs index 9d478971..83af53c9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionUserMessageCacheControl2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionUserMessageCacheControl2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionUserMessageCacheControl2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs index f3bcbc53..150421c4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatCompletionUserMessageCacheControl2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.Json.g.cs deleted file mode 100644 index 17d3d52d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatCompletionUserMessageName - { - /// - /// 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.ChatCompletionUserMessageName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatCompletionUserMessageName), - jsonSerializerContext) as global::DeepInfra.ChatCompletionUserMessageName; - } - - /// - /// 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.ChatCompletionUserMessageName? 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.ChatCompletionUserMessageName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionUserMessageName; - } - - /// - /// 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.ChatCompletionUserMessageName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs deleted file mode 100644 index 0eeac062..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ChatCompletionUserMessageName - { - - /// - /// 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.ChatReasoningSettings.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.Json.g.cs index 0f40cc2e..4fb787cb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatReasoningSettings; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatReasoningSettings? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatReasoningSettings; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs index ee63522a..26d86edb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChatReasoningSettings { /// - /// Constrains effort on reasoning for reasoning models. + /// Constrains effort on reasoning for reasoning models. Set to none to disable reasoning entirely if the model supports it. /// [global::System.Text.Json.Serialization.JsonPropertyName("effort")] public global::DeepInfra.ChatReasoningSettingsEffort2? Effort { get; set; } @@ -30,7 +30,7 @@ public sealed partial class ChatReasoningSettings /// Initializes a new instance of the class. /// /// - /// Constrains effort on reasoning for reasoning models. + /// Constrains effort on reasoning for reasoning models. Set to none to disable reasoning entirely if the model supports it. /// /// /// Enable or disable reasoning with default parameters. @@ -52,5 +52,6 @@ public ChatReasoningSettings( public ChatReasoningSettings() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs deleted file mode 100644 index 03c1d55b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatReasoningSettingsEffort - { - /// - /// 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.ChatReasoningSettingsEffort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatReasoningSettingsEffort), - jsonSerializerContext) as global::DeepInfra.ChatReasoningSettingsEffort; - } - - /// - /// 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.ChatReasoningSettingsEffort? 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.ChatReasoningSettingsEffort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatReasoningSettingsEffort; - } - - /// - /// 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.ChatReasoningSettingsEffort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs index b61d43db..23bc15a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// Constrains effort on reasoning for reasoning models. + /// Constrains effort on reasoning for reasoning models. Set to none to disable reasoning entirely if the model supports it. /// public sealed partial class ChatReasoningSettingsEffort { @@ -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..ac7f636b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs @@ -4,22 +4,38 @@ namespace DeepInfra { /// - /// + /// /// public enum ChatReasoningSettingsEffort2 { /// - /// + /// /// High, /// - /// + /// /// Low, /// - /// + /// + /// + Max, + /// + /// /// Medium, + /// + /// + /// + Minimal, + /// + /// + /// + None, + /// + /// + /// + Xhigh, } /// @@ -36,7 +52,11 @@ public static string ToValueString(this ChatReasoningSettingsEffort2 value) { ChatReasoningSettingsEffort2.High => "high", ChatReasoningSettingsEffort2.Low => "low", + ChatReasoningSettingsEffort2.Max => "max", ChatReasoningSettingsEffort2.Medium => "medium", + ChatReasoningSettingsEffort2.Minimal => "minimal", + ChatReasoningSettingsEffort2.None => "none", + ChatReasoningSettingsEffort2.Xhigh => "xhigh", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -49,7 +69,11 @@ public static string ToValueString(this ChatReasoningSettingsEffort2 value) { "high" => ChatReasoningSettingsEffort2.High, "low" => ChatReasoningSettingsEffort2.Low, + "max" => ChatReasoningSettingsEffort2.Max, "medium" => ChatReasoningSettingsEffort2.Medium, + "minimal" => ChatReasoningSettingsEffort2.Minimal, + "none" => ChatReasoningSettingsEffort2.None, + "xhigh" => ChatReasoningSettingsEffort2.Xhigh, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs deleted file mode 100644 index b50d4148..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatReasoningSettingsEnabled - { - /// - /// 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.ChatReasoningSettingsEnabled? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatReasoningSettingsEnabled), - jsonSerializerContext) as global::DeepInfra.ChatReasoningSettingsEnabled; - } - - /// - /// 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.ChatReasoningSettingsEnabled? 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.ChatReasoningSettingsEnabled), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatReasoningSettingsEnabled; - } - - /// - /// 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.ChatReasoningSettingsEnabled.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs deleted file mode 100644 index 740344b9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Enable or disable reasoning with default parameters. - /// - public sealed partial class ChatReasoningSettingsEnabled - { - - /// - /// 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.ChatTools.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.Json.g.cs deleted file mode 100644 index 66190efe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatTools - { - /// - /// 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.ChatTools? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatTools), - jsonSerializerContext) as global::DeepInfra.ChatTools; - } - - /// - /// 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.ChatTools? 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.ChatTools), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatTools; - } - - /// - /// 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.ChatTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs deleted file mode 100644 index caa4ca08..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs +++ /dev/null @@ -1,66 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ChatTools - { - /// - /// Cache control for prompt caching - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] - public object? CacheControl { get; set; } - - /// - /// Default Value: function - /// - [global::System.Text.Json.Serialization.JsonPropertyName("type")] - public string? Type { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("function")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.FunctionDefinition Function { 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. - /// - /// - /// - /// Cache control for prompt caching - /// - /// - /// Default Value: function - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public ChatTools( - global::DeepInfra.FunctionDefinition function, - object? cacheControl, - string? type) - { - this.CacheControl = cacheControl; - this.Type = type; - this.Function = function ?? throw new global::System.ArgumentNullException(nameof(function)); - } - - /// - /// Initializes a new instance of the class. - /// - public ChatTools() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs deleted file mode 100644 index e178b817..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatToolsCacheControl - { - /// - /// 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.ChatToolsCacheControl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatToolsCacheControl), - jsonSerializerContext) as global::DeepInfra.ChatToolsCacheControl; - } - - /// - /// 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.ChatToolsCacheControl? 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.ChatToolsCacheControl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatToolsCacheControl; - } - - /// - /// 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.ChatToolsCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs deleted file mode 100644 index 19435e8c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Cache control for prompt caching - /// - public sealed partial class ChatToolsCacheControl - { - - /// - /// 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.ChatToolsCacheControl2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.Json.g.cs deleted file mode 100644 index 852fdc41..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChatToolsCacheControl2 - { - /// - /// 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.ChatToolsCacheControl2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChatToolsCacheControl2), - jsonSerializerContext) as global::DeepInfra.ChatToolsCacheControl2; - } - - /// - /// 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.ChatToolsCacheControl2? 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.ChatToolsCacheControl2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatToolsCacheControl2; - } - - /// - /// 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.ChatToolsCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs deleted file mode 100644 index 6e6926d4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ChatToolsCacheControl2 - { - - /// - /// 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.Checklist.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.Json.g.cs index 8b0d5dc8..0bc426e7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.Checklist; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.Checklist? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.Checklist; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs index 64736436..cf52ff0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class Checklist { @@ -20,12 +20,24 @@ public sealed partial class Checklist [global::System.Text.Json.Serialization.JsonPropertyName("billing_address")] public bool? BillingAddress { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("billing_address_info")] + public global::DeepInfra.BillingAddressOut? BillingAddressInfo { get; set; } + /// /// Default Value: false /// [global::System.Text.Json.Serialization.JsonPropertyName("payment_method")] public bool? PaymentMethod { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("payment_method_info")] + public global::DeepInfra.PaymentMethodOut? PaymentMethodInfo { get; set; } + /// /// Default Value: false /// @@ -59,13 +71,13 @@ public sealed partial class Checklist public required double Recent { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("limit")] public double? Limit { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("suspend_reason")] public global::DeepInfra.SuspendReason? SuspendReason { get; set; } @@ -94,6 +106,18 @@ 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; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("intermediate_invoicing_threshold")] + public int? IntermediateInvoicingThreshold { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -115,9 +139,11 @@ public sealed partial class Checklist /// /// Default Value: false /// + /// /// /// Default Value: false /// + /// /// /// Default Value: false /// @@ -141,6 +167,8 @@ public sealed partial class Checklist /// /// Default Value: false /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -149,7 +177,9 @@ public Checklist( double recent, bool? email, bool? billingAddress, + global::DeepInfra.BillingAddressOut? billingAddressInfo, bool? paymentMethod, + global::DeepInfra.PaymentMethodOut? paymentMethodInfo, bool? suspended, double? overdueInvoices, int? lastChecked, @@ -158,11 +188,15 @@ public Checklist( bool? topup, int? topupAmount, int? topupThreshold, - bool? topupFailed) + bool? topupFailed, + string? billingType, + int? intermediateInvoicingThreshold) { this.Email = email; this.BillingAddress = billingAddress; + this.BillingAddressInfo = billingAddressInfo; this.PaymentMethod = paymentMethod; + this.PaymentMethodInfo = paymentMethodInfo; this.Suspended = suspended; this.OverdueInvoices = overdueInvoices; this.LastChecked = lastChecked; @@ -174,6 +208,8 @@ public Checklist( this.TopupAmount = topupAmount; this.TopupThreshold = topupThreshold; this.TopupFailed = topupFailed; + this.BillingType = billingType; + this.IntermediateInvoicingThreshold = intermediateInvoicingThreshold; } /// @@ -182,5 +218,6 @@ public Checklist( public Checklist() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingAddressInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingAddressInfo.Json.g.cs new file mode 100644 index 00000000..7e75417c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingAddressInfo.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChecklistBillingAddressInfo + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistBillingAddressInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChecklistBillingAddressInfo), + jsonSerializerContext) as global::DeepInfra.ChecklistBillingAddressInfo; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistBillingAddressInfo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ChecklistBillingAddressInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ChecklistBillingAddressInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistBillingAddressInfo; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingAddressInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingAddressInfo.g.cs new file mode 100644 index 00000000..c5606f23 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingAddressInfo.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChecklistBillingAddressInfo + { + + /// + /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.Json.g.cs deleted file mode 100644 index 55d83fc4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChecklistLimit - { - /// - /// 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.ChecklistLimit? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChecklistLimit), - jsonSerializerContext) as global::DeepInfra.ChecklistLimit; - } - - /// - /// 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.ChecklistLimit? 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.ChecklistLimit), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistLimit; - } - - /// - /// 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.ChecklistLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs deleted file mode 100644 index dd69631a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ChecklistLimit - { - - /// - /// 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.ChecklistPaymentMethodInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistPaymentMethodInfo.Json.g.cs new file mode 100644 index 00000000..8032fbf2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistPaymentMethodInfo.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChecklistPaymentMethodInfo + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistPaymentMethodInfo? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChecklistPaymentMethodInfo), + jsonSerializerContext) as global::DeepInfra.ChecklistPaymentMethodInfo; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistPaymentMethodInfo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ChecklistPaymentMethodInfo? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ChecklistPaymentMethodInfo), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistPaymentMethodInfo; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistPaymentMethodInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistPaymentMethodInfo.g.cs new file mode 100644 index 00000000..6e22fc04 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistPaymentMethodInfo.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChecklistPaymentMethodInfo + { + + /// + /// 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.ChecklistSuspendReason.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.Json.g.cs deleted file mode 100644 index cb71004e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ChecklistSuspendReason - { - /// - /// 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.ChecklistSuspendReason? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ChecklistSuspendReason), - jsonSerializerContext) as global::DeepInfra.ChecklistSuspendReason; - } - - /// - /// 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.ChecklistSuspendReason? 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.ChecklistSuspendReason), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistSuspendReason; - } - - /// - /// 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.ChecklistSuspendReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs index 199de338..abe9a69e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ChecklistSuspendReason { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.Json.g.cs index bd5a0dce..851c7f47 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CliVersionCliVersionGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CliVersionCliVersionGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CliVersionCliVersionGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs index 14eb0613..ef3b8b20 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class CliVersionCliVersionGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.Json.g.cs index 320023da..ff0223dc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CompletionMultiModalData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CompletionMultiModalData? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CompletionMultiModalData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs index 92dbb3e4..e8ad61c3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class CompletionMultiModalData { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.Json.g.cs index a4af780c..37f20564 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ConfigIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ConfigIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ConfigIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs index 71d9550b..bc820227 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ConfigIn { @@ -41,5 +41,6 @@ public ConfigIn( public ConfigIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs deleted file mode 100644 index c3c50802..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ConfigInLimit - { - /// - /// 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.ConfigInLimit? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ConfigInLimit), - jsonSerializerContext) as global::DeepInfra.ConfigInLimit; - } - - /// - /// 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.ConfigInLimit? 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.ConfigInLimit), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ConfigInLimit; - } - - /// - /// 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.ConfigInLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs deleted file mode 100644 index f1d4bee0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it - /// - public sealed partial class ConfigInLimit - { - - /// - /// 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.ConfigOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.Json.g.cs index 25ce161b..6c4076d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ConfigOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ConfigOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ConfigOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs index e0bc2bf4..41bcf1f2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ConfigOut { @@ -42,5 +42,6 @@ public ConfigOut( public ConfigOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.Json.g.cs index 5785e03d..e2b51ecc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs index 5fabca76..8c218e31 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs @@ -4,26 +4,26 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalOut { /// - /// + /// /// [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.ContainerRentalStateOutJsonConverter))] @@ -31,54 +31,54 @@ public sealed partial class ContainerRentalOut public required global::DeepInfra.ContainerRentalStateOut 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("ip")] public string? Ip { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("gpu_config")] [global::System.Text.Json.Serialization.JsonRequired] public required string GpuConfig { 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("container_image")] [global::System.Text.Json.Serialization.JsonRequired] public required string ContainerImage { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("fail_reason")] public string? FailReason { get; set; } @@ -138,5 +138,6 @@ public ContainerRentalOut( public ContainerRentalOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs deleted file mode 100644 index 84c1c7ac..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalOutFailReason - { - /// - /// 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.ContainerRentalOutFailReason? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalOutFailReason), - jsonSerializerContext) as global::DeepInfra.ContainerRentalOutFailReason; - } - - /// - /// 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.ContainerRentalOutFailReason? 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.ContainerRentalOutFailReason), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOutFailReason; - } - - /// - /// 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.ContainerRentalOutFailReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs deleted file mode 100644 index 4726eb7b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalOutFailReason - { - - /// - /// 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.ContainerRentalOutIp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.Json.g.cs deleted file mode 100644 index 221bb57b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalOutIp - { - /// - /// 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.ContainerRentalOutIp? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalOutIp), - jsonSerializerContext) as global::DeepInfra.ContainerRentalOutIp; - } - - /// - /// 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.ContainerRentalOutIp? 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.ContainerRentalOutIp), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOutIp; - } - - /// - /// 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.ContainerRentalOutIp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs deleted file mode 100644 index b70981b0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalOutIp - { - - /// - /// 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.ContainerRentalOutStopTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.Json.g.cs deleted file mode 100644 index 09c29c1c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalOutStopTs - { - /// - /// 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.ContainerRentalOutStopTs? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalOutStopTs), - jsonSerializerContext) as global::DeepInfra.ContainerRentalOutStopTs; - } - - /// - /// 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.ContainerRentalOutStopTs? 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.ContainerRentalOutStopTs), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOutStopTs; - } - - /// - /// 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.ContainerRentalOutStopTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs deleted file mode 100644 index 123f8075..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalOutStopTs - { - - /// - /// 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.ContainerRentalStartIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.Json.g.cs index eec6a16f..d27eac5f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalStartIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalStartIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalStartIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs index a0c5dafa..71bfdc8b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalStartIn { @@ -78,5 +78,6 @@ public ContainerRentalStartIn( public ContainerRentalStartIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.Json.g.cs index 5f717c88..f4c3b5a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalStartOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalStartOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalStartOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs index c5b41601..7dc57e2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalStartOut { @@ -42,5 +42,6 @@ public ContainerRentalStartOut( public ContainerRentalStartOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStateOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStateOut.g.cs index 851fd541..fe626525 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStateOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStateOut.g.cs @@ -4,32 +4,32 @@ namespace DeepInfra { /// - /// + /// /// public enum ContainerRentalStateOut { /// - /// + /// /// Creating, /// - /// + /// /// Deleted, /// - /// + /// /// Failed, /// - /// + /// /// Running, /// - /// + /// /// ShuttingDown, /// - /// + /// /// Starting, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.Json.g.cs index f0fefa0f..61d45e0f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalUpdateIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalUpdateIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalUpdateIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs index e19fe07e..33590942 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalUpdateIn { @@ -42,5 +42,6 @@ public ContainerRentalUpdateIn( public ContainerRentalUpdateIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.Json.g.cs index 9f634a1a..22c54b52 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs index 9457513c..600a24ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.Json.g.cs deleted file mode 100644 index 629fd26c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey - { - /// - /// 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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey; - } - - /// - /// 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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey? 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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey; - } - - /// - /// 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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs deleted file mode 100644 index d6848898..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey - { - - /// - /// 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.ContainerRentalsGetParamsV1ContainersParamsGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.Json.g.cs index d59e23e9..ed1304e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs index 75f44e98..ba178b41 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.Json.g.cs deleted file mode 100644 index 85ea716d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey - { - /// - /// 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.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey; - } - - /// - /// 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.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey? 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.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey; - } - - /// - /// 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.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs deleted file mode 100644 index 9019f2be..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey - { - - /// - /// 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.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.Json.g.cs deleted file mode 100644 index bde7abd6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalsGetV1ContainersContainerIdGetXiApiKey - { - /// - /// 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.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey; - } - - /// - /// 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.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey? 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.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey; - } - - /// - /// 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.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs deleted file mode 100644 index 74075bbc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalsGetV1ContainersContainerIdGetXiApiKey - { - - /// - /// 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.ContainerRentalsListV1ContainersGetState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetState.g.cs index 70ff65ea..1c7cee3e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetState.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetState.g.cs @@ -10,11 +10,11 @@ namespace DeepInfra public enum ContainerRentalsListV1ContainersGetState { /// - /// + /// /// Active, /// - /// + /// /// Inactive, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs deleted file mode 100644 index 28615eba..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalsListV1ContainersGetXiApiKey - { - /// - /// 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.ContainerRentalsListV1ContainersGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalsListV1ContainersGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ContainerRentalsListV1ContainersGetXiApiKey; - } - - /// - /// 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.ContainerRentalsListV1ContainersGetXiApiKey? 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.ContainerRentalsListV1ContainersGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsListV1ContainersGetXiApiKey; - } - - /// - /// 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.ContainerRentalsListV1ContainersGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs deleted file mode 100644 index cadb3b19..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalsListV1ContainersGetXiApiKey - { - - /// - /// 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.ContainerRentalsStartV1ContainersPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.Json.g.cs deleted file mode 100644 index 8b926fdc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalsStartV1ContainersPostXiApiKey - { - /// - /// 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.ContainerRentalsStartV1ContainersPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalsStartV1ContainersPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.ContainerRentalsStartV1ContainersPostXiApiKey; - } - - /// - /// 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.ContainerRentalsStartV1ContainersPostXiApiKey? 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.ContainerRentalsStartV1ContainersPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsStartV1ContainersPostXiApiKey; - } - - /// - /// 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.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs deleted file mode 100644 index 838477fb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalsStartV1ContainersPostXiApiKey - { - - /// - /// 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.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.Json.g.cs index 2955c635..9d39bc6b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs index 4b994d95..ec103b8c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.Json.g.cs deleted file mode 100644 index 553a1ea7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey - { - /// - /// 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.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey), - jsonSerializerContext) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey; - } - - /// - /// 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.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey? 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.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey; - } - - /// - /// 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.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs deleted file mode 100644 index 4c148664..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey - { - - /// - /// 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.CreateApiTokenV1ApiTokensPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.Json.g.cs deleted file mode 100644 index 1945aa66..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateApiTokenV1ApiTokensPostXiApiKey - { - /// - /// 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.CreateApiTokenV1ApiTokensPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateApiTokenV1ApiTokensPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateApiTokenV1ApiTokensPostXiApiKey; - } - - /// - /// 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.CreateApiTokenV1ApiTokensPostXiApiKey? 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.CreateApiTokenV1ApiTokensPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateApiTokenV1ApiTokensPostXiApiKey; - } - - /// - /// 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.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs deleted file mode 100644 index 52ec95f8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateApiTokenV1ApiTokensPostXiApiKey - { - - /// - /// 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.CreateLoraApiRequest.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.Json.g.cs index 0ab12e95..2ca3f29b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateLoraApiRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateLoraApiRequest? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateLoraApiRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs index 6f830e44..2d895639 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs @@ -4,40 +4,40 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class CreateLoraApiRequest { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("base_model")] [global::System.Text.Json.Serialization.JsonRequired] public required string BaseModel { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("lora_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string LoraName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("source")] [global::System.Text.Json.Serialization.JsonRequired] public required global::DeepInfra.SourceModel Source { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("private")] [global::System.Text.Json.Serialization.JsonRequired] public required bool Private { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("description")] public string? Description { get; set; } @@ -79,5 +79,6 @@ public CreateLoraApiRequest( public CreateLoraApiRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs deleted file mode 100644 index 0d50af29..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateLoraApiRequestDescription - { - /// - /// 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.CreateLoraApiRequestDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateLoraApiRequestDescription), - jsonSerializerContext) as global::DeepInfra.CreateLoraApiRequestDescription; - } - - /// - /// 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.CreateLoraApiRequestDescription? 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.CreateLoraApiRequestDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateLoraApiRequestDescription; - } - - /// - /// 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.CreateLoraApiRequestDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs deleted file mode 100644 index a7347f5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateLoraApiRequestDescription - { - - /// - /// 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.CreateLoraV1LoraCreatePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.Json.g.cs deleted file mode 100644 index 0aa1686f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateLoraV1LoraCreatePostXiApiKey - { - /// - /// 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.CreateLoraV1LoraCreatePostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateLoraV1LoraCreatePostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateLoraV1LoraCreatePostXiApiKey; - } - - /// - /// 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.CreateLoraV1LoraCreatePostXiApiKey? 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.CreateLoraV1LoraCreatePostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateLoraV1LoraCreatePostXiApiKey; - } - - /// - /// 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.CreateLoraV1LoraCreatePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs deleted file mode 100644 index cd1964c1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateLoraV1LoraCreatePostXiApiKey - { - - /// - /// 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.CreateOpenaiBatchV1BatchesPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.Json.g.cs deleted file mode 100644 index 3656aaeb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateOpenaiBatchV1BatchesPostXiApiKey - { - /// - /// 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.CreateOpenaiBatchV1BatchesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateOpenaiBatchV1BatchesPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateOpenaiBatchV1BatchesPostXiApiKey; - } - - /// - /// 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.CreateOpenaiBatchV1BatchesPostXiApiKey? 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.CreateOpenaiBatchV1BatchesPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateOpenaiBatchV1BatchesPostXiApiKey; - } - - /// - /// 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.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs deleted file mode 100644 index 330789d2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateOpenaiBatchV1BatchesPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.Json.g.cs deleted file mode 100644 index 0a46f128..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateScopedJwtV1ScopedJwtPostXiApiKey - { - /// - /// 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.CreateScopedJwtV1ScopedJwtPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXiApiKey; - } - - /// - /// 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.CreateScopedJwtV1ScopedJwtPostXiApiKey? 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.CreateScopedJwtV1ScopedJwtPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXiApiKey; - } - - /// - /// 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.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs deleted file mode 100644 index b4e4da5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateScopedJwtV1ScopedJwtPostXiApiKey - { - - /// - /// 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.CreateSshKeyV1SshKeysPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.Json.g.cs deleted file mode 100644 index 07f311e8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateSshKeyV1SshKeysPostXiApiKey - { - /// - /// 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.CreateSshKeyV1SshKeysPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateSshKeyV1SshKeysPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateSshKeyV1SshKeysPostXiApiKey; - } - - /// - /// 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.CreateSshKeyV1SshKeysPostXiApiKey? 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.CreateSshKeyV1SshKeysPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateSshKeyV1SshKeysPostXiApiKey; - } - - /// - /// 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.CreateSshKeyV1SshKeysPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs deleted file mode 100644 index de7715be..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateSshKeyV1SshKeysPostXiApiKey - { - - /// - /// 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.CreateVoiceV1VoicesAddPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.Json.g.cs deleted file mode 100644 index 3aa5b8be..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateVoiceV1VoicesAddPostXiApiKey - { - /// - /// 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.CreateVoiceV1VoicesAddPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateVoiceV1VoicesAddPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateVoiceV1VoicesAddPostXiApiKey; - } - - /// - /// 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.CreateVoiceV1VoicesAddPostXiApiKey? 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.CreateVoiceV1VoicesAddPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVoiceV1VoicesAddPostXiApiKey; - } - - /// - /// 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.CreateVoiceV1VoicesAddPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs deleted file mode 100644 index 600643f6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateVoiceV1VoicesAddPostXiApiKey - { - - /// - /// 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.DeepError.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.Json.g.cs index efd29e0f..9182e975 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepError? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs index 7a4ae3cc..ea96cf8d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeepError { @@ -42,5 +42,6 @@ public DeepError( public DeepError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.Json.g.cs index 83663431..32812b24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs index 1c9ef521..bbedd034 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs @@ -4,59 +4,59 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeepStartApplicationIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] public string? Id { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("uid")] public string? Uid { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("company")] [global::System.Text.Json.Serialization.JsonRequired] public required string Company { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("ceo")] [global::System.Text.Json.Serialization.JsonRequired] public required string Ceo { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("funding")] [global::System.Text.Json.Serialization.JsonRequired] public required string Funding { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("founded_on")] [global::System.Text.Json.Serialization.JsonRequired] public required string FoundedOn { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("website")] [global::System.Text.Json.Serialization.JsonRequired] public required string Website { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] public int? CreatedAt { get; set; } @@ -68,7 +68,7 @@ public sealed partial class DeepStartApplicationIn public string? Status { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("deal")] public string? Deal { get; set; } @@ -127,5 +127,6 @@ public DeepStartApplicationIn( public DeepStartApplicationIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs deleted file mode 100644 index 6c3b7cb3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeepStartApplicationInDeal - { - /// - /// 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.DeepStartApplicationInDeal? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeepStartApplicationInDeal), - jsonSerializerContext) as global::DeepInfra.DeepStartApplicationInDeal; - } - - /// - /// 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.DeepStartApplicationInDeal? 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.DeepStartApplicationInDeal), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationInDeal; - } - - /// - /// 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.DeepStartApplicationInDeal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs deleted file mode 100644 index 4dcb93a7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeepStartApplicationInDeal - { - - /// - /// 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.DeepStartApplicationInUid.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs deleted file mode 100644 index 29e9287d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeepStartApplicationInUid - { - /// - /// 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.DeepStartApplicationInUid? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeepStartApplicationInUid), - jsonSerializerContext) as global::DeepInfra.DeepStartApplicationInUid; - } - - /// - /// 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.DeepStartApplicationInUid? 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.DeepStartApplicationInUid), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationInUid; - } - - /// - /// 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.DeepStartApplicationInUid.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs deleted file mode 100644 index b77c6532..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeepStartApplicationInUid - { - - /// - /// 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.DeepStartApplicationOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.Json.g.cs index f8f9190a..027feb9d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs index 7795beb7..267c4e78 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs @@ -4,59 +4,59 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeepStartApplicationOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] public string? Id { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("uid")] public string? Uid { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("company")] [global::System.Text.Json.Serialization.JsonRequired] public required string Company { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("ceo")] [global::System.Text.Json.Serialization.JsonRequired] public required string Ceo { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("funding")] [global::System.Text.Json.Serialization.JsonRequired] public required string Funding { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("founded_on")] [global::System.Text.Json.Serialization.JsonRequired] public required string FoundedOn { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("website")] [global::System.Text.Json.Serialization.JsonRequired] public required string Website { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] public int? CreatedAt { get; set; } @@ -68,13 +68,13 @@ public sealed partial class DeepStartApplicationOut public string? Status { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("deal")] public string? Deal { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("email")] public string? Email { get; set; } @@ -136,5 +136,6 @@ public DeepStartApplicationOut( public DeepStartApplicationOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs deleted file mode 100644 index 96b94f4c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeepStartApplicationOutDeal - { - /// - /// 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.DeepStartApplicationOutDeal? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeepStartApplicationOutDeal), - jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOutDeal; - } - - /// - /// 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.DeepStartApplicationOutDeal? 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.DeepStartApplicationOutDeal), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOutDeal; - } - - /// - /// 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.DeepStartApplicationOutDeal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs deleted file mode 100644 index 694f7e00..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeepStartApplicationOutDeal - { - - /// - /// 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.DeepStartApplicationOutEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs deleted file mode 100644 index 3e1a957e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeepStartApplicationOutEmail - { - /// - /// 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.DeepStartApplicationOutEmail? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeepStartApplicationOutEmail), - jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOutEmail; - } - - /// - /// 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.DeepStartApplicationOutEmail? 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.DeepStartApplicationOutEmail), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOutEmail; - } - - /// - /// 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.DeepStartApplicationOutEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs deleted file mode 100644 index d97c4fc9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeepStartApplicationOutEmail - { - - /// - /// 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.DeepStartApplicationOutUid.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs deleted file mode 100644 index cf071a8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeepStartApplicationOutUid - { - /// - /// 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.DeepStartApplicationOutUid? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeepStartApplicationOutUid), - jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOutUid; - } - - /// - /// 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.DeepStartApplicationOutUid? 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.DeepStartApplicationOutUid), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOutUid; - } - - /// - /// 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.DeepStartApplicationOutUid.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs deleted file mode 100644 index 2619412d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeepStartApplicationOutUid - { - - /// - /// 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.DeepstartApplyPaymentDeepstartApplicationPostSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.Json.g.cs index 68afe1e8..796896a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepstartApplyPaymentDeepstartApplicationPostSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepstartApplyPaymentDeepstartApplicationPostSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepstartApplyPaymentDeepstartApplicationPostSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs index 182af052..294e17ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeepstartApplyPaymentDeepstartApplicationPostSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.Json.g.cs deleted file mode 100644 index 05970de7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeleteAccountV1MeDeleteXiApiKey - { - /// - /// 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.DeleteAccountV1MeDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeleteAccountV1MeDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeleteAccountV1MeDeleteXiApiKey; - } - - /// - /// 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.DeleteAccountV1MeDeleteXiApiKey? 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.DeleteAccountV1MeDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteAccountV1MeDeleteXiApiKey; - } - - /// - /// 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.DeleteAccountV1MeDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs deleted file mode 100644 index 0cf20c76..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeleteAccountV1MeDeleteXiApiKey - { - - /// - /// 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.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.Json.g.cs index c4d2ae70..73b35df7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs index 48877b1c..203b7aa3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.Json.g.cs deleted file mode 100644 index e48cd827..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey - { - /// - /// 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.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey; - } - - /// - /// 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.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey? 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.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey; - } - - /// - /// 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.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs deleted file mode 100644 index 67c82c60..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey - { - - /// - /// 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.DeleteFileV1FilesFileIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteResponse.Json.g.cs new file mode 100644 index 00000000..f5f6fb6d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteFileV1FilesFileIdDeleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse), + jsonSerializerContext) as global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteFileV1FilesFileIdDeleteResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteResponse.g.cs new file mode 100644 index 00000000..c4935da9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteFileV1FilesFileIdDeleteResponse + { + + /// + /// 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.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.Json.g.cs index f99eddc3..a17d191d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs index bab1a15d..6b40a502 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.Json.g.cs deleted file mode 100644 index a56eb257..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey - { - /// - /// 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.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey; - } - - /// - /// 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.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey? 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.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey; - } - - /// - /// 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.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs deleted file mode 100644 index c67d70d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey - { - - /// - /// 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.DeleteLoraV1LoraLoraNameDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.Json.g.cs index bf0285d7..7e9ff5a5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs index 97fd6215..a9adb0ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeleteLoraV1LoraLoraNameDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.Json.g.cs deleted file mode 100644 index 96be9ba8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeleteLoraV1LoraLoraNameDeleteXiApiKey - { - /// - /// 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.DeleteLoraV1LoraLoraNameDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXiApiKey; - } - - /// - /// 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.DeleteLoraV1LoraLoraNameDeleteXiApiKey? 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.DeleteLoraV1LoraLoraNameDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXiApiKey; - } - - /// - /// 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.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs deleted file mode 100644 index 548a55d9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeleteLoraV1LoraLoraNameDeleteXiApiKey - { - - /// - /// 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.Json.g.cs index 31479938..0b7a3832 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs index 1c28b2ba..34b32f7c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.Json.g.cs deleted file mode 100644 index c6e057e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey - { - /// - /// 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey; - } - - /// - /// 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey? 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey; - } - - /// - /// 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs deleted file mode 100644 index e5958d5a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey - { - - /// - /// 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.DeleteVoiceV1VoicesVoiceIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.Json.g.cs index 26e25eb5..52ef9782 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs index f17d7da7..40e9d754 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.Json.g.cs deleted file mode 100644 index 538d67b5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey - { - /// - /// 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.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey; - } - - /// - /// 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.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey? 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.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey; - } - - /// - /// 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.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs deleted file mode 100644 index bf5abcb2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey - { - - /// - /// 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.DeployArgsHistoryOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOut.Json.g.cs new file mode 100644 index 00000000..a36f9e0b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployArgsHistoryOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployArgsHistoryOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployArgsHistoryOut), + jsonSerializerContext) as global::DeepInfra.DeployArgsHistoryOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployArgsHistoryOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployArgsHistoryOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployArgsHistoryOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployArgsHistoryOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOut.g.cs new file mode 100644 index 00000000..8a951512 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOut.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployArgsHistoryOut + { + /// + /// Identifier of this past config; pass it to POST /deploy/{deploy_id}/config/history/{entry_id}/restore. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("entry_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string EntryId { get; set; } + + /// + /// When this config was retired. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("retired_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string RetiredAt { get; set; } + + /// + /// Engine tuning knobs of this config. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + [global::System.Text.Json.Serialization.JsonRequired] + public required object StandardArgs { get; set; } + + /// + /// Extra engine-specific command-line args of this config (custom-weight deploys only). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("extra_args")] + public global::System.Collections.Generic.IList? ExtraArgs { 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. + /// + /// + /// Identifier of this past config; pass it to POST /deploy/{deploy_id}/config/history/{entry_id}/restore. + /// + /// + /// When this config was retired. + /// + /// + /// Engine tuning knobs of this config. + /// + /// + /// Extra engine-specific command-line args of this config (custom-weight deploys only). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeployArgsHistoryOut( + string entryId, + string retiredAt, + object standardArgs, + global::System.Collections.Generic.IList? extraArgs) + { + this.EntryId = entryId ?? throw new global::System.ArgumentNullException(nameof(entryId)); + this.RetiredAt = retiredAt ?? throw new global::System.ArgumentNullException(nameof(retiredAt)); + this.StandardArgs = standardArgs ?? throw new global::System.ArgumentNullException(nameof(standardArgs)); + this.ExtraArgs = extraArgs; + } + + /// + /// Initializes a new instance of the class. + /// + public DeployArgsHistoryOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOutStandardArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOutStandardArgs.Json.g.cs new file mode 100644 index 00000000..70ea0a82 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOutStandardArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployArgsHistoryOutStandardArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployArgsHistoryOutStandardArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployArgsHistoryOutStandardArgs), + jsonSerializerContext) as global::DeepInfra.DeployArgsHistoryOutStandardArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployArgsHistoryOutStandardArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployArgsHistoryOutStandardArgs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployArgsHistoryOutStandardArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployArgsHistoryOutStandardArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOutStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOutStandardArgs.g.cs new file mode 100644 index 00000000..d45c93df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployArgsHistoryOutStandardArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Engine tuning knobs of this config. + /// + public sealed partial class DeployArgsHistoryOutStandardArgs + { + + /// + /// 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.DeployCreateHfDeployHfPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.Json.g.cs deleted file mode 100644 index ba041c4d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployCreateHfDeployHfPostXiApiKey - { - /// - /// 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.DeployCreateHfDeployHfPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployCreateHfDeployHfPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployCreateHfDeployHfPostXiApiKey; - } - - /// - /// 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.DeployCreateHfDeployHfPostXiApiKey? 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.DeployCreateHfDeployHfPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateHfDeployHfPostXiApiKey; - } - - /// - /// 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.DeployCreateHfDeployHfPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs deleted file mode 100644 index b762f323..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployCreateHfDeployHfPostXiApiKey - { - - /// - /// 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.DeployCreateLlmDeployLlmPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.Json.g.cs deleted file mode 100644 index 2f40f8ad..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployCreateLlmDeployLlmPostXiApiKey - { - /// - /// 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.DeployCreateLlmDeployLlmPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployCreateLlmDeployLlmPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployCreateLlmDeployLlmPostXiApiKey; - } - - /// - /// 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.DeployCreateLlmDeployLlmPostXiApiKey? 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.DeployCreateLlmDeployLlmPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateLlmDeployLlmPostXiApiKey; - } - - /// - /// 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.DeployCreateLlmDeployLlmPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs deleted file mode 100644 index c757eb36..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployCreateLlmDeployLlmPostXiApiKey - { - - /// - /// 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.DeployCreateV1DeployPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.Json.g.cs deleted file mode 100644 index 0180b393..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployCreateV1DeployPostXiApiKey - { - /// - /// 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.DeployCreateV1DeployPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployCreateV1DeployPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployCreateV1DeployPostXiApiKey; - } - - /// - /// 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.DeployCreateV1DeployPostXiApiKey? 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.DeployCreateV1DeployPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateV1DeployPostXiApiKey; - } - - /// - /// 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.DeployCreateV1DeployPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs deleted file mode 100644 index eeeaa48a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployCreateV1DeployPostXiApiKey - { - - /// - /// 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.DeployDelete.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.Json.g.cs index 00388788..03057070 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployDelete; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployDelete? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDelete; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs index 2129ce5b..446bc569 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployDelete { @@ -42,5 +42,6 @@ public DeployDelete( public DeployDelete() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.Json.g.cs deleted file mode 100644 index 752dd358..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployDeleteDeployDeployIdDeleteXiApiKey - { - /// - /// 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.DeployDeleteDeployDeployIdDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployDeleteDeployDeployIdDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployDeleteDeployDeployIdDeleteXiApiKey; - } - - /// - /// 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.DeployDeleteDeployDeployIdDeleteXiApiKey? 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.DeployDeleteDeployDeployIdDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDeleteDeployDeployIdDeleteXiApiKey; - } - - /// - /// 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.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs deleted file mode 100644 index 8eb4d038..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployDeleteDeployDeployIdDeleteXiApiKey - { - - /// - /// 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.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.Json.g.cs deleted file mode 100644 index 9f1c97bb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployDetailedStatsDeployDeployIdStats2GetXiApiKey - { - /// - /// 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.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey; - } - - /// - /// 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.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey? 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.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey; - } - - /// - /// 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.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs deleted file mode 100644 index 2b1cf707..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployDetailedStatsDeployDeployIdStats2GetXiApiKey - { - - /// - /// 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.DeployGPUAvailability.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.Json.g.cs index 31cdd545..5db7cfe7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployGPUAvailability; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployGPUAvailability? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployGPUAvailability; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs index aadc8a0a..c0b5d578 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployGPUAvailability { @@ -42,5 +42,6 @@ public DeployGPUAvailability( public DeployGPUAvailability() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUs.g.cs index 7b0717ae..6db11ff8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUs.g.cs @@ -4,44 +4,44 @@ namespace DeepInfra { /// - /// + /// /// public enum DeployGPUs { /// - /// + /// /// A10080gb, /// - /// + /// /// B200180gb, /// - /// + /// /// B300270gb, /// - /// + /// /// H10080gb, /// - /// + /// /// H200141gb, /// - /// + /// /// L424gb, /// - /// + /// /// L40s48gb, /// - /// + /// /// Rtxpro600096gb, /// - /// + /// /// Other, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs deleted file mode 100644 index 56d5e6d4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey - { - /// - /// 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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey; - } - - /// - /// 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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey? 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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey; - } - - /// - /// 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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs deleted file mode 100644 index ae38fd34..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey - { - - /// - /// 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.DeployInstances.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.Json.g.cs index 3d402456..3b40e088 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployInstances; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployInstances? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployInstances; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs index bd0d8125..76acaa37 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployInstances { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("running")] [global::System.Text.Json.Serialization.JsonRequired] public required int Running { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pending")] [global::System.Text.Json.Serialization.JsonRequired] @@ -50,5 +50,6 @@ public DeployInstances( public DeployInstances() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.Json.g.cs index 05f59c24..f1722230 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMConfig? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs index 5c271ec7..0fa7bead 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployLLMConfig { @@ -78,5 +78,6 @@ public DeployLLMConfig( public DeployLLMConfig() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.Json.g.cs index 810a15cd..4d4705b4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMConfigWeights; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMConfigWeights? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMConfigWeights; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.Json.g.cs index 91ab6cbb..3f779bdf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs index d50dad61..49c05a07 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployLLMIn { @@ -16,7 +16,7 @@ public sealed partial class DeployLLMIn public required string ModelName { get; set; } /// - /// The type of GPU the deployment is running on + /// The type of GPU the deployment is running on. /// [global::System.Text.Json.Serialization.JsonPropertyName("gpu")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.DeployGPUsJsonConverter))] @@ -31,14 +31,7 @@ public sealed partial class DeployLLMIn public int? NumGpus { get; set; } /// - /// Maximum number of concurrent requests
- /// Default Value: 96 - ///
- [global::System.Text.Json.Serialization.JsonPropertyName("max_batch_size")] - public int? MaxBatchSize { get; set; } - - /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("hf")] public global::DeepInfra.HFWeights? Hf { get; set; } @@ -56,7 +49,7 @@ public sealed partial class DeployLLMIn public string? ContainerImage { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("settings")] public global::DeepInfra.ScaleSettings? Settings { get; set; } @@ -67,6 +60,18 @@ public sealed partial class DeployLLMIn [global::System.Text.Json.Serialization.JsonPropertyName("extra_args")] public global::System.Collections.Generic.IList? ExtraArgs { get; set; } + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. Unset knobs use the model/engine defaults. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + public global::DeepInfra.StandardArgs? StandardArgs { get; set; } + + /// + /// Apply a stored preset or vLLM recipe by id. A non-empty standard_args or extra_args in this request replaces the preset's whole matching field. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("preset_id")] + public string? PresetId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -80,16 +85,12 @@ public sealed partial class DeployLLMIn /// model name for deepinfra (username/mode-name format) /// /// - /// The type of GPU the deployment is running on + /// 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 @@ -101,6 +102,12 @@ public sealed partial class DeployLLMIn /// /// Extra command line arguments for custom deployments /// + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. Unset knobs use the model/engine defaults. + /// + /// + /// Apply a stored preset or vLLM recipe by id. A non-empty standard_args or extra_args in this request replaces the preset's whole matching field. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -108,22 +115,24 @@ public DeployLLMIn( string modelName, global::DeepInfra.DeployGPUs gpu, int? numGpus, - int? maxBatchSize, global::DeepInfra.HFWeights? hf, string? baseModel, string? containerImage, global::DeepInfra.ScaleSettings? settings, - global::System.Collections.Generic.IList? extraArgs) + global::System.Collections.Generic.IList? extraArgs, + global::DeepInfra.StandardArgs? standardArgs, + string? presetId) { this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); this.Gpu = gpu; this.NumGpus = numGpus; - this.MaxBatchSize = maxBatchSize; this.Hf = hf; this.BaseModel = baseModel; this.ContainerImage = containerImage; this.Settings = settings; this.ExtraArgs = extraArgs; + this.StandardArgs = standardArgs; + this.PresetId = presetId; } /// @@ -132,5 +141,6 @@ public DeployLLMIn( public DeployLLMIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.Json.g.cs deleted file mode 100644 index fc3d9189..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployLLMInBaseModel - { - /// - /// 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.DeployLLMInBaseModel? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployLLMInBaseModel), - jsonSerializerContext) as global::DeepInfra.DeployLLMInBaseModel; - } - - /// - /// 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.DeployLLMInBaseModel? 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.DeployLLMInBaseModel), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInBaseModel; - } - - /// - /// 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.DeployLLMInBaseModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs deleted file mode 100644 index a78344b6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Base public model - /// - public sealed partial class DeployLLMInBaseModel - { - - /// - /// 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.DeployLLMInContainerImage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.Json.g.cs deleted file mode 100644 index 60fcbfd8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployLLMInContainerImage - { - /// - /// 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.DeployLLMInContainerImage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployLLMInContainerImage), - jsonSerializerContext) as global::DeepInfra.DeployLLMInContainerImage; - } - - /// - /// 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.DeployLLMInContainerImage? 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.DeployLLMInContainerImage), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInContainerImage; - } - - /// - /// 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.DeployLLMInContainerImage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs deleted file mode 100644 index 47e596e5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) - /// - public sealed partial class DeployLLMInContainerImage - { - - /// - /// 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.DeployLLMInExtraArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.Json.g.cs deleted file mode 100644 index 47cba468..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployLLMInExtraArgs - { - /// - /// 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.DeployLLMInExtraArgs? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployLLMInExtraArgs), - jsonSerializerContext) as global::DeepInfra.DeployLLMInExtraArgs; - } - - /// - /// 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.DeployLLMInExtraArgs? 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.DeployLLMInExtraArgs), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInExtraArgs; - } - - /// - /// 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.DeployLLMInExtraArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs deleted file mode 100644 index 25800eac..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Extra command line arguments for custom deployments - /// - public sealed partial class DeployLLMInExtraArgs - { - - /// - /// 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.DeployLLMInHf.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.Json.g.cs index d3041a92..719bfe5c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMInHf; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInHf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInHf; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs index 01f1bb07..d9d0b4ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployLLMInHf { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.Json.g.cs index 0f8fbf6d..12ba8df0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMInSettings; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInSettings? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInSettings; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs index 25921b1b..b906834b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployLLMInSettings { @@ -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.DeployLLMInStandardArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInStandardArgs.Json.g.cs new file mode 100644 index 00000000..1e7cc243 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInStandardArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLLMInStandardArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInStandardArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLLMInStandardArgs), + jsonSerializerContext) as global::DeepInfra.DeployLLMInStandardArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInStandardArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployLLMInStandardArgs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployLLMInStandardArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInStandardArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInStandardArgs.g.cs new file mode 100644 index 00000000..04d5dc51 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInStandardArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. Unset knobs use the model/engine defaults. + /// + public sealed partial class DeployLLMInStandardArgs + { + + /// + /// 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.DeployLLMUpdateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.Json.g.cs index 43aa007b..004129b6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMUpdateIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMUpdateIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMUpdateIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs index 049388c2..9fece9b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs @@ -4,16 +4,27 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployLLMUpdateIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("settings")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.ScaleSettings Settings { get; set; } + public global::DeepInfra.ScaleSettings? Settings { get; set; } + + /// + /// Engine tuning knobs. Replaces the whole set; omitted knobs are cleared. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + public global::DeepInfra.StandardArgs? StandardArgs { get; set; } + + /// + /// Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("extra_args")] + public global::System.Collections.Generic.IList? ExtraArgs { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -25,13 +36,23 @@ public sealed partial class DeployLLMUpdateIn /// Initializes a new instance of the class. /// /// + /// + /// Engine tuning knobs. Replaces the whole set; omitted knobs are cleared. + /// + /// + /// Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public DeployLLMUpdateIn( - global::DeepInfra.ScaleSettings settings) + global::DeepInfra.ScaleSettings? settings, + global::DeepInfra.StandardArgs? standardArgs, + global::System.Collections.Generic.IList? extraArgs) { - this.Settings = settings ?? throw new global::System.ArgumentNullException(nameof(settings)); + this.Settings = settings; + this.StandardArgs = standardArgs; + this.ExtraArgs = extraArgs; } /// @@ -40,5 +61,6 @@ public DeployLLMUpdateIn( public DeployLLMUpdateIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInSettings.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInSettings.Json.g.cs new file mode 100644 index 00000000..1799cc8b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInSettings.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLLMUpdateInSettings + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMUpdateInSettings? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLLMUpdateInSettings), + jsonSerializerContext) as global::DeepInfra.DeployLLMUpdateInSettings; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMUpdateInSettings? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployLLMUpdateInSettings? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployLLMUpdateInSettings), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMUpdateInSettings; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInSettings.g.cs new file mode 100644 index 00000000..4e2943f1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInSettings.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLLMUpdateInSettings + { + + /// + /// 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.DeployLLMUpdateInStandardArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInStandardArgs.Json.g.cs new file mode 100644 index 00000000..d9809afd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInStandardArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLLMUpdateInStandardArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMUpdateInStandardArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLLMUpdateInStandardArgs), + jsonSerializerContext) as global::DeepInfra.DeployLLMUpdateInStandardArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMUpdateInStandardArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployLLMUpdateInStandardArgs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployLLMUpdateInStandardArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMUpdateInStandardArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInStandardArgs.g.cs new file mode 100644 index 00000000..b0c3dd1d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInStandardArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Engine tuning knobs. Replaces the whole set; omitted knobs are cleared. + /// + public sealed partial class DeployLLMUpdateInStandardArgs + { + + /// + /// 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.DeployListDeployListGetStatus.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.Json.g.cs deleted file mode 100644 index 0cfcaaf5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployListDeployListGetStatus - { - /// - /// 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.DeployListDeployListGetStatus? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployListDeployListGetStatus), - jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetStatus; - } - - /// - /// 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.DeployListDeployListGetStatus? 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.DeployListDeployListGetStatus), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetStatus; - } - - /// - /// 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.DeployListDeployListGetStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs deleted file mode 100644 index a1d1b3ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted - /// - public sealed partial class DeployListDeployListGetStatus - { - - /// - /// 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.DeployListDeployListGetStatus2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.Json.g.cs deleted file mode 100644 index 47f3d63f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployListDeployListGetStatus2 - { - /// - /// 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.DeployListDeployListGetStatus2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployListDeployListGetStatus2), - jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetStatus2; - } - - /// - /// 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.DeployListDeployListGetStatus2? 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.DeployListDeployListGetStatus2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetStatus2; - } - - /// - /// 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.DeployListDeployListGetStatus2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs deleted file mode 100644 index 4462e019..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted - /// - public sealed partial class DeployListDeployListGetStatus2 - { - - /// - /// 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.DeployListDeployListGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.Json.g.cs deleted file mode 100644 index 083a3b14..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployListDeployListGetXiApiKey - { - /// - /// 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.DeployListDeployListGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployListDeployListGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetXiApiKey; - } - - /// - /// 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.DeployListDeployListGetXiApiKey? 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.DeployListDeployListGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetXiApiKey; - } - - /// - /// 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.DeployListDeployListGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs deleted file mode 100644 index c7cb6295..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployListDeployListGetXiApiKey - { - - /// - /// 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.DeployListDeployListGetXiApiKey2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.Json.g.cs deleted file mode 100644 index a30bd9d7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployListDeployListGetXiApiKey2 - { - /// - /// 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.DeployListDeployListGetXiApiKey2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployListDeployListGetXiApiKey2), - jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetXiApiKey2; - } - - /// - /// 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.DeployListDeployListGetXiApiKey2? 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.DeployListDeployListGetXiApiKey2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetXiApiKey2; - } - - /// - /// 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.DeployListDeployListGetXiApiKey2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs deleted file mode 100644 index ffcecc2b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployListDeployListGetXiApiKey2 - { - - /// - /// 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.DeployLlmPresetsDeployLlmPresetsGetGpu.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetGpu.g.cs new file mode 100644 index 00000000..f836fb1b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetGpu.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetGpu + { + + /// + /// 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.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse.Json.g.cs new file mode 100644 index 00000000..68e007ed --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmStandardArgsDeployLlmStandardArgsGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse), + jsonSerializerContext) as global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse.g.cs new file mode 100644 index 00000000..a6c38377 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmStandardArgsDeployLlmStandardArgsGetResponse + { + + /// + /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.Json.g.cs index 82b70538..e40b5f66 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployModelIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployModelIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployModelIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs index c98ce302..363e21f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployModelIn { @@ -67,5 +67,6 @@ public DeployModelIn( public DeployModelIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs deleted file mode 100644 index 9141c311..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployModelInVersion - { - /// - /// 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.DeployModelInVersion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployModelInVersion), - jsonSerializerContext) as global::DeepInfra.DeployModelInVersion; - } - - /// - /// 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.DeployModelInVersion? 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.DeployModelInVersion), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployModelInVersion; - } - - /// - /// 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.DeployModelInVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs deleted file mode 100644 index 4d6373b4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A specific revision, if left empty uses the last one - /// - public sealed partial class DeployModelInVersion - { - - /// - /// 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.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest.Json.g.cs new file mode 100644 index 00000000..b6da7a48 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest), + jsonSerializerContext) as global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest.g.cs new file mode 100644 index 00000000..511ab3da --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployRebalanceCancelDeployDeployIdRebalanceCancelPostRequest + { + + /// + /// 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.DeployResult.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.Json.g.cs index 7b39d33a..0be8371e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployResult; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployResult? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployResult; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs index 4cc0bdab..28183918 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployResult { @@ -42,5 +42,6 @@ public DeployResult( public DeployResult() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRollout.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRollout.Json.g.cs new file mode 100644 index 00000000..d36ce5b0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRollout.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployRollout + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeployRollout? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployRollout), + jsonSerializerContext) as global::DeepInfra.DeployRollout; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployRollout? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeployRollout? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeployRollout), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployRollout; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRollout.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRollout.g.cs new file mode 100644 index 00000000..ee141886 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployRollout.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployRollout + { + /// + /// Instances serving the current config. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("up_to_date")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int UpToDate { get; set; } + + /// + /// Instances still serving a previous config. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("outdated")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Outdated { get; set; } + + /// + /// Instances starting up. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("booting")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Booting { 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. + /// + /// + /// Instances serving the current config. + /// + /// + /// Instances still serving a previous config. + /// + /// + /// Instances starting up. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeployRollout( + int upToDate, + int outdated, + int booting) + { + this.UpToDate = upToDate; + this.Outdated = outdated; + this.Booting = booting; + } + + /// + /// Initializes a new instance of the class. + /// + public DeployRollout() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.Json.g.cs deleted file mode 100644 index 56142a9d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployStartDeployDeployIdStartPostXiApiKey - { - /// - /// 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.DeployStartDeployDeployIdStartPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployStartDeployDeployIdStartPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployStartDeployDeployIdStartPostXiApiKey; - } - - /// - /// 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.DeployStartDeployDeployIdStartPostXiApiKey? 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.DeployStartDeployDeployIdStartPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStartDeployDeployIdStartPostXiApiKey; - } - - /// - /// 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.DeployStartDeployDeployIdStartPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs deleted file mode 100644 index 0db29134..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployStartDeployDeployIdStartPostXiApiKey - { - - /// - /// 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.DeployStatsDeployDeployIdStatsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.Json.g.cs deleted file mode 100644 index 4c0bf854..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployStatsDeployDeployIdStatsGetXiApiKey - { - /// - /// 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.DeployStatsDeployDeployIdStatsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployStatsDeployDeployIdStatsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployStatsDeployDeployIdStatsGetXiApiKey; - } - - /// - /// 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.DeployStatsDeployDeployIdStatsGetXiApiKey? 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.DeployStatsDeployDeployIdStatsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatsDeployDeployIdStatsGetXiApiKey; - } - - /// - /// 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.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs deleted file mode 100644 index aea696c3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployStatsDeployDeployIdStatsGetXiApiKey - { - - /// - /// 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.DeployStatusDeployDeployIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.Json.g.cs deleted file mode 100644 index 6aec5120..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployStatusDeployDeployIdGetXiApiKey - { - /// - /// 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.DeployStatusDeployDeployIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployStatusDeployDeployIdGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployStatusDeployDeployIdGetXiApiKey; - } - - /// - /// 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.DeployStatusDeployDeployIdGetXiApiKey? 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.DeployStatusDeployDeployIdGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatusDeployDeployIdGetXiApiKey; - } - - /// - /// 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.DeployStatusDeployDeployIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs deleted file mode 100644 index b3214252..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployStatusDeployDeployIdGetXiApiKey - { - - /// - /// 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.DeployStatusOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.Json.g.cs index 02d308ec..66107130 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployStatusOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStatusOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatusOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs index 76672cc6..d415d60e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeployStatusOut { @@ -42,5 +42,6 @@ public DeployStatusOut( public DeployStatusOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.Json.g.cs deleted file mode 100644 index 858ff0d6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployStopDeployDeployIdStopPostXiApiKey - { - /// - /// 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.DeployStopDeployDeployIdStopPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployStopDeployDeployIdStopPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployStopDeployDeployIdStopPostXiApiKey; - } - - /// - /// 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.DeployStopDeployDeployIdStopPostXiApiKey? 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.DeployStopDeployDeployIdStopPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStopDeployDeployIdStopPostXiApiKey; - } - - /// - /// 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.DeployStopDeployDeployIdStopPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs deleted file mode 100644 index 7d50f87e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployStopDeployDeployIdStopPostXiApiKey - { - - /// - /// 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.DeployType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployType.g.cs index 896e265e..b5dc35e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployType.g.cs @@ -4,24 +4,24 @@ namespace DeepInfra { /// - /// + /// /// public enum DeployType { /// - /// + /// /// Legacy, /// - /// + /// /// Llm, /// - /// + /// /// Lora, /// - /// + /// /// Tts, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs deleted file mode 100644 index d2a00afe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeployUpdateDeployDeployIdPutXiApiKey - { - /// - /// 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.DeployUpdateDeployDeployIdPutXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeployUpdateDeployDeployIdPutXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeployUpdateDeployDeployIdPutXiApiKey; - } - - /// - /// 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.DeployUpdateDeployDeployIdPutXiApiKey? 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.DeployUpdateDeployDeployIdPutXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployUpdateDeployDeployIdPutXiApiKey; - } - - /// - /// 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.DeployUpdateDeployDeployIdPutXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs deleted file mode 100644 index 3375f154..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeployUpdateDeployDeployIdPutXiApiKey - { - - /// - /// 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.DeploymentLogQueryOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.Json.g.cs index ab9f5769..c437e3ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentLogQueryOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogQueryOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogQueryOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs index 3ea8a879..e4907a92 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeploymentLogQueryOut { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.Json.g.cs index 07efed60..bd88c181 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentLogQueryOutEntries; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogQueryOutEntries? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogQueryOutEntries; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.Json.g.cs deleted file mode 100644 index 55951915..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetFrom - { - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom), - jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom? 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.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs deleted file mode 100644 index 14cefcbf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetFrom - { - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs deleted file mode 100644 index ea05ba53..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetPodName - { - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName), - jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName? 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.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs deleted file mode 100644 index d15081e1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// the pod name to get the logs from - /// - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetPodName - { - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs deleted file mode 100644 index 5d1c24fc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetTo - { - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetTo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetTo), - jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetTo; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetTo? 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.DeploymentLogsQueryV1DeploymentLogsQueryGetTo), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetTo; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs deleted file mode 100644 index 2516b034..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetTo - { - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.Json.g.cs deleted file mode 100644 index 4497f659..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey - { - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey? 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey; - } - - /// - /// 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs deleted file mode 100644 index 0264d8c1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey - { - - /// - /// 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.DeploymentMainStatsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.Json.g.cs index 7bc85aa8..f6321fdd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentMainStatsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentMainStatsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentMainStatsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs index 2ddb3531..613fc7eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeploymentMainStatsOut { @@ -54,5 +54,6 @@ public DeploymentMainStatsOut( public DeploymentMainStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.Json.g.cs index c9bb5a50..9167ae42 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs index eff1b19a..19ce3bb5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeploymentOut { @@ -89,6 +89,30 @@ public sealed partial class DeploymentOut [global::System.Text.Json.Serialization.JsonPropertyName("settings")] public global::DeepInfra.ScaleSettings? Settings { get; set; } + /// + /// Current engine tuning knobs + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + public global::DeepInfra.DeploymentOutStandardArgs? StandardArgs { get; set; } + + /// + /// Current extra engine-specific command-line args (custom-weight deploys only) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("extra_args")] + public global::System.Collections.Generic.IList? ExtraArgs { get; set; } + + /// + /// If the last config update was auto-reverted after an engine crash-loop, the error that caused it (status stays 'running') + /// + [global::System.Text.Json.Serialization.JsonPropertyName("update_error")] + public string? UpdateError { get; set; } + + /// + /// Per-instance rollout progress of the current config + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rollout")] + public global::DeepInfra.DeployRollout? Rollout { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -134,6 +158,18 @@ public sealed partial class DeploymentOut /// /// Scale Settings /// + /// + /// Current engine tuning knobs + /// + /// + /// Current extra engine-specific command-line args (custom-weight deploys only) + /// + /// + /// If the last config update was auto-reverted after an engine crash-loop, the error that caused it (status stays 'running') + /// + /// + /// Per-instance rollout progress of the current config + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -149,7 +185,11 @@ public DeploymentOut( global::DeepInfra.DeployType? type, global::DeepInfra.DeployInstances? instances, global::DeepInfra.DeployLLMConfig? config, - global::DeepInfra.ScaleSettings? settings) + global::DeepInfra.ScaleSettings? settings, + global::DeepInfra.DeploymentOutStandardArgs? standardArgs, + global::System.Collections.Generic.IList? extraArgs, + string? updateError, + global::DeepInfra.DeployRollout? rollout) { this.Type = type; this.DeployId = deployId ?? throw new global::System.ArgumentNullException(nameof(deployId)); @@ -163,6 +203,10 @@ public DeploymentOut( this.Instances = instances; this.Config = config; this.Settings = settings; + this.StandardArgs = standardArgs; + this.ExtraArgs = extraArgs; + this.UpdateError = updateError; + this.Rollout = rollout; } /// @@ -171,5 +215,6 @@ public DeploymentOut( public DeploymentOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.Json.g.cs index c857291c..21334cc4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutConfig.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentOutConfig; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutConfig? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutConfig; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.Json.g.cs index 9b37f844..1fb5e140 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutInstances.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentOutInstances; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutInstances? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutInstances; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.DeploymentOutRollout.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutRollout.Json.g.cs new file mode 100644 index 00000000..d03dce09 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutRollout.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeploymentOutRollout + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutRollout? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeploymentOutRollout), + jsonSerializerContext) as global::DeepInfra.DeploymentOutRollout; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutRollout? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeploymentOutRollout? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeploymentOutRollout), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutRollout; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutRollout.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutRollout.g.cs new file mode 100644 index 00000000..a69e58f6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutRollout.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Per-instance rollout progress of the current config + /// + public sealed partial class DeploymentOutRollout + { + + /// + /// 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.DeploymentOutSettings.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.Json.g.cs index 60ccc739..7ebe4dce 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutSettings.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentOutSettings; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutSettings? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutSettings; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.DeploymentOutStandardArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs.Json.g.cs new file mode 100644 index 00000000..82084f57 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeploymentOutStandardArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutStandardArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeploymentOutStandardArgs), + jsonSerializerContext) as global::DeepInfra.DeploymentOutStandardArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutStandardArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DeploymentOutStandardArgs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DeploymentOutStandardArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutStandardArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs.g.cs new file mode 100644 index 00000000..016ee465 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs.g.cs @@ -0,0 +1,112 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Current engine tuning knobs + /// + public sealed partial class DeploymentOutStandardArgs + { + /// + /// Maximum total sequence length (prompt + generation). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_context_size")] + public int? MaxContextSize { get; set; } + + /// + /// Max number of requests served concurrently. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_concurrent_requests")] + public int? MaxConcurrentRequests { get; set; } + + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_memory_fraction")] + public double? GpuMemoryFraction { get; set; } + + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_prefill_tokens")] + public int? MaxPrefillTokens { get; set; } + + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("kv_cache_dtype")] + public global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2? KvCacheDtype { get; set; } + + /// + /// Reuse KV cache for shared prompt prefixes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_prefix_caching")] + public bool? EnablePrefixCaching { get; set; } + + /// + /// On-the-fly weight quantization method. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] + public global::DeepInfra.DeploymentOutStandardArgsQuantization2? Quantization { 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. + /// + /// + /// Maximum total sequence length (prompt + generation). + /// + /// + /// Max number of requests served concurrently. + /// + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + /// + /// Reuse KV cache for shared prompt prefixes. + /// + /// + /// On-the-fly weight quantization method. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeploymentOutStandardArgs( + int? maxContextSize, + int? maxConcurrentRequests, + double? gpuMemoryFraction, + int? maxPrefillTokens, + global::DeepInfra.DeploymentOutStandardArgsKvCacheDtype2? kvCacheDtype, + bool? enablePrefixCaching, + global::DeepInfra.DeploymentOutStandardArgsQuantization2? quantization) + { + this.MaxContextSize = maxContextSize; + this.MaxConcurrentRequests = maxConcurrentRequests; + this.GpuMemoryFraction = gpuMemoryFraction; + this.MaxPrefillTokens = maxPrefillTokens; + this.KvCacheDtype = kvCacheDtype; + this.EnablePrefixCaching = enablePrefixCaching; + this.Quantization = quantization; + } + + /// + /// Initializes a new instance of the class. + /// + public DeploymentOutStandardArgs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsKvCacheDtype.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsKvCacheDtype.g.cs new file mode 100644 index 00000000..3b119fb0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsKvCacheDtype.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + public sealed partial class DeploymentOutStandardArgsKvCacheDtype + { + + /// + /// 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.DeploymentOutStandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..f7318279 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsKvCacheDtype2.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum DeploymentOutStandardArgsKvCacheDtype2 + { + /// + /// + /// + Auto, + /// + /// + /// + Fp8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeploymentOutStandardArgsKvCacheDtype2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeploymentOutStandardArgsKvCacheDtype2 value) + { + return value switch + { + DeploymentOutStandardArgsKvCacheDtype2.Auto => "auto", + DeploymentOutStandardArgsKvCacheDtype2.Fp8 => "fp8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeploymentOutStandardArgsKvCacheDtype2? ToEnum(string value) + { + return value switch + { + "auto" => DeploymentOutStandardArgsKvCacheDtype2.Auto, + "fp8" => DeploymentOutStandardArgsKvCacheDtype2.Fp8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsQuantization.g.cs new file mode 100644 index 00000000..05cd7b10 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsQuantization.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// On-the-fly weight quantization method. + /// + public sealed partial class DeploymentOutStandardArgsQuantization + { + + /// + /// 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.DeploymentOutStandardArgsQuantization2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsQuantization2.g.cs new file mode 100644 index 00000000..1a53a62e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgsQuantization2.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum DeploymentOutStandardArgsQuantization2 + { + /// + /// + /// + Awq, + /// + /// + /// + AwqMarlin, + /// + /// + /// + Bitsandbytes, + /// + /// + /// + CompressedTensors, + /// + /// + /// + Fp8, + /// + /// + /// + Gptq, + /// + /// + /// + GptqMarlin, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class DeploymentOutStandardArgsQuantization2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this DeploymentOutStandardArgsQuantization2 value) + { + return value switch + { + DeploymentOutStandardArgsQuantization2.Awq => "awq", + DeploymentOutStandardArgsQuantization2.AwqMarlin => "awq_marlin", + DeploymentOutStandardArgsQuantization2.Bitsandbytes => "bitsandbytes", + DeploymentOutStandardArgsQuantization2.CompressedTensors => "compressed-tensors", + DeploymentOutStandardArgsQuantization2.Fp8 => "fp8", + DeploymentOutStandardArgsQuantization2.Gptq => "gptq", + DeploymentOutStandardArgsQuantization2.GptqMarlin => "gptq_marlin", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static DeploymentOutStandardArgsQuantization2? ToEnum(string value) + { + return value switch + { + "awq" => DeploymentOutStandardArgsQuantization2.Awq, + "awq_marlin" => DeploymentOutStandardArgsQuantization2.AwqMarlin, + "bitsandbytes" => DeploymentOutStandardArgsQuantization2.Bitsandbytes, + "compressed-tensors" => DeploymentOutStandardArgsQuantization2.CompressedTensors, + "fp8" => DeploymentOutStandardArgsQuantization2.Fp8, + "gptq" => DeploymentOutStandardArgsQuantization2.Gptq, + "gptq_marlin" => DeploymentOutStandardArgsQuantization2.GptqMarlin, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs deleted file mode 100644 index fcda0ac1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DeploymentStatsDeployStatsGetXiApiKey - { - /// - /// 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.DeploymentStatsDeployStatsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DeploymentStatsDeployStatsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.DeploymentStatsDeployStatsGetXiApiKey; - } - - /// - /// 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.DeploymentStatsDeployStatsGetXiApiKey? 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.DeploymentStatsDeployStatsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentStatsDeployStatsGetXiApiKey; - } - - /// - /// 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.DeploymentStatsDeployStatsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs deleted file mode 100644 index 38954a2e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class DeploymentStatsDeployStatsGetXiApiKey - { - - /// - /// 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.DeploymentStatsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.Json.g.cs index 0a401f84..aadab1d8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentStatsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentStatsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentStatsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs index 75cc6b34..05e8b789 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DeploymentStatsOut { @@ -138,5 +138,6 @@ public DeploymentStatsOut( public DeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.Json.g.cs index 5a71334f..74205fa3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DetailedDeploymentStatsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetailedDeploymentStatsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetailedDeploymentStatsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs index 5e94f173..1c9c70c0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DetailedDeploymentStatsOut { @@ -63,5 +63,6 @@ public DetailedDeploymentStatsOut( public DetailedDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.Json.g.cs index 93bc5648..3da91675 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DetailedDeploymentStatsOutEmbeddings; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetailedDeploymentStatsOutEmbeddings? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetailedDeploymentStatsOutEmbeddings; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.Json.g.cs index eb9b05bd..cb127624 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutLlm.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DetailedDeploymentStatsOutLlm; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetailedDeploymentStatsOutLlm? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetailedDeploymentStatsOutLlm; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.Json.g.cs index 15ab7593..87c2f468 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutTime.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DetailedDeploymentStatsOutTime; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetailedDeploymentStatsOutTime? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetailedDeploymentStatsOutTime; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.DetokenizeIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeIn.Json.g.cs new file mode 100644 index 00000000..e6410ed9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DetokenizeIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DetokenizeIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DetokenizeIn), + jsonSerializerContext) as global::DeepInfra.DetokenizeIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetokenizeIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DetokenizeIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DetokenizeIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetokenizeIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeIn.g.cs new file mode 100644 index 00000000..476abb67 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeIn.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DetokenizeIn + { + /// + /// model name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// token ids to detokenize + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokens")] + public global::System.Collections.Generic.IList? Tokens { 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. + /// + /// + /// model name + /// + /// + /// token ids to detokenize + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DetokenizeIn( + string model, + global::System.Collections.Generic.IList? tokens) + { + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Tokens = tokens; + } + + /// + /// Initializes a new instance of the class. + /// + public DetokenizeIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeOut.Json.g.cs new file mode 100644 index 00000000..4ddf104c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DetokenizeOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.DetokenizeOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DetokenizeOut), + jsonSerializerContext) as global::DeepInfra.DetokenizeOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetokenizeOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.DetokenizeOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.DetokenizeOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetokenizeOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeOut.g.cs new file mode 100644 index 00000000..24a9df20 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DetokenizeOut + { + /// + /// detokenized text + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { 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. + /// + /// + /// detokenized text + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DetokenizeOut( + string prompt) + { + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + } + + /// + /// Initializes a new instance of the class. + /// + public DetokenizeOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.Json.g.cs index b34a5459..aaf58cab 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DiscountMeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DiscountMeta? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DiscountMeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs index a67b53e9..250c49d9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DiscountMeta { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("name")] [global::System.Text.Json.Serialization.JsonRequired] @@ -51,5 +51,6 @@ public DiscountMeta( public DiscountMeta() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs deleted file mode 100644 index 89f95a59..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class DiscountMetaDescription - { - /// - /// 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.DiscountMetaDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.DiscountMetaDescription), - jsonSerializerContext) as global::DeepInfra.DiscountMetaDescription; - } - - /// - /// 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.DiscountMetaDescription? 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.DiscountMetaDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DiscountMetaDescription; - } - - /// - /// 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.DiscountMetaDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs deleted file mode 100644 index 15a36059..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// description of the discount, only for display purposes - /// - public sealed partial class DiscountMetaDescription - { - - /// - /// 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.DisplayNameIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.Json.g.cs index f3d7b421..0f970cb2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DisplayNameIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DisplayNameIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DisplayNameIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs index 52d39002..0375bb51 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class DisplayNameIn { @@ -42,5 +42,6 @@ public DisplayNameIn( public DisplayNameIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.Json.g.cs index 660dc05d..7e788d4f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ElevenLabsTextToSpeechIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ElevenLabsTextToSpeechIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ElevenLabsTextToSpeechIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs index e2bdf2d7..9389e267 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ElevenLabsTextToSpeechIn { @@ -31,7 +31,7 @@ public sealed partial class ElevenLabsTextToSpeechIn public global::DeepInfra.TtsResponseFormat? OutputFormat { get; set; } /// - /// ISO 639-1, 2 letter language code + /// ISO 639-1, 2-letter language code /// [global::System.Text.Json.Serialization.JsonPropertyName("language_code")] public string? LanguageCode { get; set; } @@ -57,7 +57,7 @@ public sealed partial class ElevenLabsTextToSpeechIn /// Default Value: wav /// /// - /// ISO 639-1, 2 letter language code + /// ISO 639-1, 2-letter language code /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -80,5 +80,6 @@ public ElevenLabsTextToSpeechIn( public ElevenLabsTextToSpeechIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs deleted file mode 100644 index 16af02b4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ElevenLabsTextToSpeechInLanguageCode - { - /// - /// 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.ElevenLabsTextToSpeechInLanguageCode? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ElevenLabsTextToSpeechInLanguageCode), - jsonSerializerContext) as global::DeepInfra.ElevenLabsTextToSpeechInLanguageCode; - } - - /// - /// 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.ElevenLabsTextToSpeechInLanguageCode? 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.ElevenLabsTextToSpeechInLanguageCode), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ElevenLabsTextToSpeechInLanguageCode; - } - - /// - /// 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.ElevenLabsTextToSpeechInLanguageCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs deleted file mode 100644 index 24743f81..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// ISO 639-1, 2 letter language code - /// - public sealed partial class ElevenLabsTextToSpeechInLanguageCode - { - - /// - /// 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.EmailsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.Json.g.cs index 88d83e7f..9f695489 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.EmailsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.EmailsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.EmailsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs index 48851bc8..0a7ca1fb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class EmailsOut { @@ -42,5 +42,6 @@ public EmailsOut( public EmailsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.Json.g.cs index 87fecb02..9614575f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.EmbeddingsDeploymentStatsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.EmbeddingsDeploymentStatsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.EmbeddingsDeploymentStatsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs index 4fe855d0..ddde18b9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class EmbeddingsDeploymentStatsOut { @@ -102,5 +102,6 @@ public EmbeddingsDeploymentStatsOut( public EmbeddingsDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.Json.g.cs index 646704e6..229a0a92 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs index c9c94464..5dfd0e2e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.Json.g.cs deleted file mode 100644 index d2a5013d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey - { - /// - /// 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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey; - } - - /// - /// 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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey? 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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey; - } - - /// - /// 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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs deleted file mode 100644 index 06717c23..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey - { - - /// - /// 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.FAQEntryOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.Json.g.cs index c521dcfd..9033bc0b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FAQEntryOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FAQEntryOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FAQEntryOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs index 3d550485..1ece8371 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class FAQEntryOut { @@ -79,5 +79,6 @@ public FAQEntryOut( public FAQEntryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.Json.g.cs index 300421ed..00609317 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FeedbackIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FeedbackIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FeedbackIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs index 97a10144..a806d489 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class FeedbackIn { @@ -53,5 +53,6 @@ public FeedbackIn( public FeedbackIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs deleted file mode 100644 index 891d8a77..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class FeedbackInContactEmail - { - /// - /// 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.FeedbackInContactEmail? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.FeedbackInContactEmail), - jsonSerializerContext) as global::DeepInfra.FeedbackInContactEmail; - } - - /// - /// 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.FeedbackInContactEmail? 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.FeedbackInContactEmail), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FeedbackInContactEmail; - } - - /// - /// 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.FeedbackInContactEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs deleted file mode 100644 index 7d199dee..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Optional contact email to reach you back - /// - public sealed partial class FeedbackInContactEmail - { - - /// - /// 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.Function.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.Json.g.cs index 0a255984..a25b756c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.Function; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.Function? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.Function; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs index bccd09bb..7aa8bd13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class Function { @@ -54,5 +54,6 @@ public Function( public Function() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.Json.g.cs index 5dbcf8cf..3abba2bd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FunctionDefinition; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionDefinition? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionDefinition; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs index 005d5323..c3bc3b11 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs @@ -4,25 +4,25 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class FunctionDefinition { /// - /// + /// /// [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("description")] public string? Description { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("parameters")] public object? Parameters { get; set; } @@ -58,5 +58,6 @@ public FunctionDefinition( public FunctionDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs deleted file mode 100644 index 6c700f30..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class FunctionDefinitionDescription - { - /// - /// 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.FunctionDefinitionDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.FunctionDefinitionDescription), - jsonSerializerContext) as global::DeepInfra.FunctionDefinitionDescription; - } - - /// - /// 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.FunctionDefinitionDescription? 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.FunctionDefinitionDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionDefinitionDescription; - } - - /// - /// 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.FunctionDefinitionDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs deleted file mode 100644 index 8c8e6af2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class FunctionDefinitionDescription - { - - /// - /// 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.FunctionDefinitionParameters.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.Json.g.cs index 4c4306f5..38a60c2b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FunctionDefinitionParameters; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionDefinitionParameters? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionDefinitionParameters; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs index 23cec2da..2578b1fe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class FunctionDefinitionParameters { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.Json.g.cs index 41c64372..f883f1d1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FunctionDefinitionParameters2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionDefinitionParameters2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionDefinitionParameters2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs index fb9f5221..b6328810 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class FunctionDefinitionParameters2 { @@ -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.FunctionTool.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionTool.Json.g.cs new file mode 100644 index 00000000..4cd5f830 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionTool.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class FunctionTool + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.FunctionTool? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.FunctionTool), + jsonSerializerContext) as global::DeepInfra.FunctionTool; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionTool? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.FunctionTool? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.FunctionTool), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionTool; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionTool.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionTool.g.cs new file mode 100644 index 00000000..272f2614 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionTool.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class FunctionTool + { + /// + /// Cache control for prompt caching + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cache_control")] + public object? CacheControl { get; set; } + + /// + /// Default Value: function + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("function")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.FunctionDefinition Function { 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. + /// + /// + /// + /// Cache control for prompt caching + /// + /// + /// Default Value: function + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public FunctionTool( + global::DeepInfra.FunctionDefinition function, + object? cacheControl, + string? type) + { + this.CacheControl = cacheControl; + this.Type = type; + this.Function = function ?? throw new global::System.ArgumentNullException(nameof(function)); + } + + /// + /// Initializes a new instance of the class. + /// + public FunctionTool() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl.Json.g.cs new file mode 100644 index 00000000..ac7d7ac2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class FunctionToolCacheControl + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.FunctionToolCacheControl? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.FunctionToolCacheControl), + jsonSerializerContext) as global::DeepInfra.FunctionToolCacheControl; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionToolCacheControl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.FunctionToolCacheControl? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.FunctionToolCacheControl), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionToolCacheControl; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl.g.cs new file mode 100644 index 00000000..ea792efb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Cache control for prompt caching + /// + public sealed partial class FunctionToolCacheControl + { + + /// + /// 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.FunctionToolCacheControl2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl2.Json.g.cs new file mode 100644 index 00000000..a1d61095 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class FunctionToolCacheControl2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.FunctionToolCacheControl2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.FunctionToolCacheControl2), + jsonSerializerContext) as global::DeepInfra.FunctionToolCacheControl2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionToolCacheControl2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.FunctionToolCacheControl2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.FunctionToolCacheControl2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionToolCacheControl2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl2.g.cs new file mode 100644 index 00000000..fb625508 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionToolCacheControl2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class FunctionToolCacheControl2 + { + + /// + /// 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.GPUAvailabilityInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.Json.g.cs index 39584b03..35fe5d00 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GPUAvailabilityInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GPUAvailabilityInfo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GPUAvailabilityInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs index 19c309d0..53f37202 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs @@ -4,26 +4,26 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GPUAvailabilityInfo { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("gpu_config")] [global::System.Text.Json.Serialization.JsonRequired] public required string GpuConfig { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("usd_per_hour")] [global::System.Text.Json.Serialization.JsonRequired] public required double UsdPerHour { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("available")] [global::System.Text.Json.Serialization.JsonRequired] @@ -71,5 +71,6 @@ public GPUAvailabilityInfo( public GPUAvailabilityInfo() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.Json.g.cs deleted file mode 100644 index 9f52ef1f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetApiTokenV1ApiTokensApiTokenGetXiApiKey - { - /// - /// 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.GetApiTokenV1ApiTokensApiTokenGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXiApiKey; - } - - /// - /// 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.GetApiTokenV1ApiTokensApiTokenGetXiApiKey? 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.GetApiTokenV1ApiTokensApiTokenGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXiApiKey; - } - - /// - /// 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.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs deleted file mode 100644 index 9489f8a2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetApiTokenV1ApiTokensApiTokenGetXiApiKey - { - - /// - /// 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.GetApiTokensV1ApiTokensGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.Json.g.cs deleted file mode 100644 index f631b0f1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetApiTokensV1ApiTokensGetXiApiKey - { - /// - /// 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.GetApiTokensV1ApiTokensGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetApiTokensV1ApiTokensGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetApiTokensV1ApiTokensGetXiApiKey; - } - - /// - /// 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.GetApiTokensV1ApiTokensGetXiApiKey? 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.GetApiTokensV1ApiTokensGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetApiTokensV1ApiTokensGetXiApiKey; - } - - /// - /// 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.GetApiTokensV1ApiTokensGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs deleted file mode 100644 index 0e59736f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetApiTokensV1ApiTokensGetXiApiKey - { - - /// - /// 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.GetChecklistPaymentChecklistGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.Json.g.cs index 3b03c5d0..9152a9bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetChecklistPaymentChecklistGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetChecklistPaymentChecklistGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetChecklistPaymentChecklistGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs index b14b6109..c3106160 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetChecklistPaymentChecklistGetSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.Json.g.cs index 58c6d470..a2893365 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetConfigPaymentConfigGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetConfigPaymentConfigGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetConfigPaymentConfigGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs index 10f7252f..555a4051 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetConfigPaymentConfigGetSession { @@ -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.GetFileContentV1FilesFileIdContentGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetResponse.Json.g.cs new file mode 100644 index 00000000..c0bc7975 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetFileContentV1FilesFileIdContentGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse), + jsonSerializerContext) as global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetFileContentV1FilesFileIdContentGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetResponse.g.cs new file mode 100644 index 00000000..0f84b66f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetFileContentV1FilesFileIdContentGetResponse + { + + /// + /// 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.GetHardwareV2HardwareGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.Json.g.cs deleted file mode 100644 index cb34975e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetHardwareV2HardwareGetXiApiKey - { - /// - /// 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.GetHardwareV2HardwareGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetHardwareV2HardwareGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetHardwareV2HardwareGetXiApiKey; - } - - /// - /// 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.GetHardwareV2HardwareGetXiApiKey? 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.GetHardwareV2HardwareGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetHardwareV2HardwareGetXiApiKey; - } - - /// - /// 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.GetHardwareV2HardwareGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs deleted file mode 100644 index a9c32ad5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetHardwareV2HardwareGetXiApiKey - { - - /// - /// 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.GetLoraStatusV1LoraLoraNameStatusGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.Json.g.cs index c07866dd..55ed46c0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs index 101a6c12..8ea3b348 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.Json.g.cs deleted file mode 100644 index 7e382c06..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetXiApiKey - { - /// - /// 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.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey; - } - - /// - /// 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.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey? 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.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey; - } - - /// - /// 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.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs deleted file mode 100644 index 61b95933..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetXiApiKey - { - - /// - /// 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.GetLoraV1LoraLoraNameGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.Json.g.cs index 598db579..9876b74a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetLoraV1LoraLoraNameGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetLoraV1LoraLoraNameGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraV1LoraLoraNameGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs index 00e2c923..96615848 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetLoraV1LoraLoraNameGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.Json.g.cs deleted file mode 100644 index 2c52d8e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetLoraV1LoraLoraNameGetXiApiKey - { - /// - /// 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.GetLoraV1LoraLoraNameGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetLoraV1LoraLoraNameGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetLoraV1LoraLoraNameGetXiApiKey; - } - - /// - /// 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.GetLoraV1LoraLoraNameGetXiApiKey? 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.GetLoraV1LoraLoraNameGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraV1LoraLoraNameGetXiApiKey; - } - - /// - /// 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.GetLoraV1LoraLoraNameGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs deleted file mode 100644 index 71adacfc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetLoraV1LoraLoraNameGetXiApiKey - { - - /// - /// 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.GetModelLorasV1ModelModelNameLorasGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.Json.g.cs index d02c0b7a..485e6945 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs index d1ee567c..40d98750 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetModelLorasV1ModelModelNameLorasGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.Json.g.cs deleted file mode 100644 index bc08a12e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetModelLorasV1ModelModelNameLorasGetXiApiKey - { - /// - /// 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.GetModelLorasV1ModelModelNameLorasGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXiApiKey; - } - - /// - /// 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.GetModelLorasV1ModelModelNameLorasGetXiApiKey? 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.GetModelLorasV1ModelModelNameLorasGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXiApiKey; - } - - /// - /// 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.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs deleted file mode 100644 index 527437d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetModelLorasV1ModelModelNameLorasGetXiApiKey - { - - /// - /// 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.GetRequestCostsV1RequestCostsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.Json.g.cs deleted file mode 100644 index 455d33e6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetRequestCostsV1RequestCostsPostXiApiKey - { - /// - /// 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.GetRequestCostsV1RequestCostsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetRequestCostsV1RequestCostsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetRequestCostsV1RequestCostsPostXiApiKey; - } - - /// - /// 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.GetRequestCostsV1RequestCostsPostXiApiKey? 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.GetRequestCostsV1RequestCostsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetRequestCostsV1RequestCostsPostXiApiKey; - } - - /// - /// 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.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs deleted file mode 100644 index ab9febfa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetRequestCostsV1RequestCostsPostXiApiKey - { - - /// - /// 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.GetSshKeysV1SshKeysGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.Json.g.cs deleted file mode 100644 index a9a89a1f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetSshKeysV1SshKeysGetXiApiKey - { - /// - /// 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.GetSshKeysV1SshKeysGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetSshKeysV1SshKeysGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetSshKeysV1SshKeysGetXiApiKey; - } - - /// - /// 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.GetSshKeysV1SshKeysGetXiApiKey? 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.GetSshKeysV1SshKeysGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetSshKeysV1SshKeysGetXiApiKey; - } - - /// - /// 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.GetSshKeysV1SshKeysGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs deleted file mode 100644 index d1a5112c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetSshKeysV1SshKeysGetXiApiKey - { - - /// - /// 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.GetUserLorasV1UserLorasGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.Json.g.cs index 5824e2b8..eb2047ce 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetUserLorasV1UserLorasGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetUserLorasV1UserLorasGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetUserLorasV1UserLorasGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs index 0a824f61..d6b405c4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetUserLorasV1UserLorasGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.Json.g.cs deleted file mode 100644 index a6781f6b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetUserLorasV1UserLorasGetXiApiKey - { - /// - /// 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.GetUserLorasV1UserLorasGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetUserLorasV1UserLorasGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetUserLorasV1UserLorasGetXiApiKey; - } - - /// - /// 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.GetUserLorasV1UserLorasGetXiApiKey? 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.GetUserLorasV1UserLorasGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetUserLorasV1UserLorasGetXiApiKey; - } - - /// - /// 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.GetUserLorasV1UserLorasGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs deleted file mode 100644 index 1ec8e24c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetUserLorasV1UserLorasGetXiApiKey - { - - /// - /// 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.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse.Json.g.cs new file mode 100644 index 00000000..a0403e77 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoContentV1OpenaiVideosVideoIdContentGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse), + jsonSerializerContext) as global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse.g.cs new file mode 100644 index 00000000..e169932b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoContentV1OpenaiVideosVideoIdContentGetResponse + { + + /// + /// 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.GetVideoContentV1VideosVideoIdContentGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetResponse.Json.g.cs new file mode 100644 index 00000000..bf0d814f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoContentV1VideosVideoIdContentGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse), + jsonSerializerContext) as global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetResponse.g.cs new file mode 100644 index 00000000..6e40ec9b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoContentV1VideosVideoIdContentGetResponse + { + + /// + /// 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.GetVoiceV1VoicesVoiceIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.Json.g.cs deleted file mode 100644 index 25b23360..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetVoiceV1VoicesVoiceIdGetXiApiKey - { - /// - /// 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.GetVoiceV1VoicesVoiceIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXiApiKey; - } - - /// - /// 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.GetVoiceV1VoicesVoiceIdGetXiApiKey? 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.GetVoiceV1VoicesVoiceIdGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXiApiKey; - } - - /// - /// 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.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs deleted file mode 100644 index 7c3cf4cd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetVoiceV1VoicesVoiceIdGetXiApiKey - { - - /// - /// 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.GetVoicesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.Json.g.cs index 2e0d4a81..1a860c3b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetVoicesOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVoicesOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoicesOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs index a2b435ea..4da1c463 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GetVoicesOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("voices")] public global::System.Collections.Generic.IList? Voices { get; set; } @@ -39,5 +39,6 @@ public GetVoicesOut( public GetVoicesOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.Json.g.cs deleted file mode 100644 index b658e3d2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GetVoicesV1VoicesGetXiApiKey - { - /// - /// 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.GetVoicesV1VoicesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GetVoicesV1VoicesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.GetVoicesV1VoicesGetXiApiKey; - } - - /// - /// 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.GetVoicesV1VoicesGetXiApiKey? 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.GetVoicesV1VoicesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoicesV1VoicesGetXiApiKey; - } - - /// - /// 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.GetVoicesV1VoicesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs deleted file mode 100644 index b22026d3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GetVoicesV1VoicesGetXiApiKey - { - - /// - /// 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.GithubCliLoginGithubCliLoginGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.Json.g.cs index 0627d010..4e9b1e97 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GithubCliLoginGithubCliLoginGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GithubCliLoginGithubCliLoginGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubCliLoginGithubCliLoginGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs index dc02bbe8..e3072448 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GithubCliLoginGithubCliLoginGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.Json.g.cs deleted file mode 100644 index f66f0ece..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GithubLoginGithubLoginGetDeal - { - /// - /// 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.GithubLoginGithubLoginGetDeal? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GithubLoginGithubLoginGetDeal), - jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetDeal; - } - - /// - /// 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.GithubLoginGithubLoginGetDeal? 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.GithubLoginGithubLoginGetDeal), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetDeal; - } - - /// - /// 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.GithubLoginGithubLoginGetDeal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs deleted file mode 100644 index e064de2c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GithubLoginGithubLoginGetDeal - { - - /// - /// 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.GithubLoginGithubLoginGetLoginId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.Json.g.cs deleted file mode 100644 index 0833fb47..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GithubLoginGithubLoginGetLoginId - { - /// - /// 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.GithubLoginGithubLoginGetLoginId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GithubLoginGithubLoginGetLoginId), - jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetLoginId; - } - - /// - /// 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.GithubLoginGithubLoginGetLoginId? 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.GithubLoginGithubLoginGetLoginId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetLoginId; - } - - /// - /// 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.GithubLoginGithubLoginGetLoginId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs deleted file mode 100644 index 3e032fd7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GithubLoginGithubLoginGetLoginId - { - - /// - /// 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.GithubLoginGithubLoginGetOrigin.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.Json.g.cs deleted file mode 100644 index f4d0333b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GithubLoginGithubLoginGetOrigin - { - /// - /// 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.GithubLoginGithubLoginGetOrigin? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GithubLoginGithubLoginGetOrigin), - jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetOrigin; - } - - /// - /// 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.GithubLoginGithubLoginGetOrigin? 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.GithubLoginGithubLoginGetOrigin), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetOrigin; - } - - /// - /// 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.GithubLoginGithubLoginGetOrigin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs deleted file mode 100644 index e914a01f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GithubLoginGithubLoginGetOrigin - { - - /// - /// 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.GithubLoginGithubLoginGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.Json.g.cs index e8f1fb7c..c1b4b8cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GithubLoginGithubLoginGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs index 84a7eb6f..de9f7bd8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class GithubLoginGithubLoginGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.Json.g.cs deleted file mode 100644 index a7a2f427..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GithubLoginGithubLoginGetTiToken - { - /// - /// 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.GithubLoginGithubLoginGetTiToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GithubLoginGithubLoginGetTiToken), - jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetTiToken; - } - - /// - /// 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.GithubLoginGithubLoginGetTiToken? 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.GithubLoginGithubLoginGetTiToken), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetTiToken; - } - - /// - /// 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.GithubLoginGithubLoginGetTiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs deleted file mode 100644 index aab03976..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GithubLoginGithubLoginGetTiToken - { - - /// - /// 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.GoogleLoginGoogleLoginGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GoogleLoginGoogleLoginGetResponse.Json.g.cs new file mode 100644 index 00000000..3af8cffc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GoogleLoginGoogleLoginGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GoogleLoginGoogleLoginGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GoogleLoginGoogleLoginGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GoogleLoginGoogleLoginGetResponse), + jsonSerializerContext) as global::DeepInfra.GoogleLoginGoogleLoginGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GoogleLoginGoogleLoginGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GoogleLoginGoogleLoginGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GoogleLoginGoogleLoginGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GoogleLoginGoogleLoginGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GoogleLoginGoogleLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GoogleLoginGoogleLoginGetResponse.g.cs new file mode 100644 index 00000000..7367a310 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GoogleLoginGoogleLoginGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GoogleLoginGoogleLoginGetResponse + { + + /// + /// 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.GpuLimitOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.Json.g.cs deleted file mode 100644 index 54c4fa48..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GpuLimitOut - { - /// - /// 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.GpuLimitOut? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GpuLimitOut), - jsonSerializerContext) as global::DeepInfra.GpuLimitOut; - } - - /// - /// 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.GpuLimitOut? 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.GpuLimitOut), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOut; - } - - /// - /// 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.GpuLimitOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs deleted file mode 100644 index 440cebfa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs +++ /dev/null @@ -1,57 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GpuLimitOut - { - /// - /// Effective GPU limits per type (defaults merged with overrides) - /// - [global::System.Text.Json.Serialization.JsonPropertyName("limits")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.Dictionary Limits { get; set; } - - /// - /// Pending GPU limit increase requests per type - /// - [global::System.Text.Json.Serialization.JsonPropertyName("pending_requests")] - public global::System.Collections.Generic.Dictionary? PendingRequests { 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. - /// - /// - /// Effective GPU limits per type (defaults merged with overrides) - /// - /// - /// Pending GPU limit increase requests per type - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public GpuLimitOut( - global::System.Collections.Generic.Dictionary limits, - global::System.Collections.Generic.Dictionary? pendingRequests) - { - this.Limits = limits ?? throw new global::System.ArgumentNullException(nameof(limits)); - this.PendingRequests = pendingRequests; - } - - /// - /// Initializes a new instance of the class. - /// - public GpuLimitOut() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs deleted file mode 100644 index dfad955b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GpuLimitOutLimits - { - /// - /// 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.GpuLimitOutLimits? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GpuLimitOutLimits), - jsonSerializerContext) as global::DeepInfra.GpuLimitOutLimits; - } - - /// - /// 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.GpuLimitOutLimits? 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.GpuLimitOutLimits), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOutLimits; - } - - /// - /// 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.GpuLimitOutLimits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs deleted file mode 100644 index 67d854a1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Effective GPU limits per type (defaults merged with overrides) - /// - public sealed partial class GpuLimitOutLimits - { - - /// - /// 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.GpuLimitOutPendingRequests.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.Json.g.cs deleted file mode 100644 index 1bbcc29c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GpuLimitOutPendingRequests - { - /// - /// 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.GpuLimitOutPendingRequests? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GpuLimitOutPendingRequests), - jsonSerializerContext) as global::DeepInfra.GpuLimitOutPendingRequests; - } - - /// - /// 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.GpuLimitOutPendingRequests? 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.GpuLimitOutPendingRequests), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOutPendingRequests; - } - - /// - /// 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.GpuLimitOutPendingRequests.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs deleted file mode 100644 index c7c6cb88..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Pending GPU limit increase requests per type - /// - public sealed partial class GpuLimitOutPendingRequests - { - - /// - /// 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.GpuLimitOutPendingRequests2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.Json.g.cs deleted file mode 100644 index bd03d8f5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GpuLimitOutPendingRequests2 - { - /// - /// 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.GpuLimitOutPendingRequests2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GpuLimitOutPendingRequests2), - jsonSerializerContext) as global::DeepInfra.GpuLimitOutPendingRequests2; - } - - /// - /// 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.GpuLimitOutPendingRequests2? 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.GpuLimitOutPendingRequests2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOutPendingRequests2; - } - - /// - /// 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.GpuLimitOutPendingRequests2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs deleted file mode 100644 index 8d4af715..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GpuLimitOutPendingRequests2 - { - - /// - /// 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.GpuLimitRequestIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.Json.g.cs deleted file mode 100644 index 1df74afe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class GpuLimitRequestIn - { - /// - /// 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.GpuLimitRequestIn? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.GpuLimitRequestIn), - jsonSerializerContext) as global::DeepInfra.GpuLimitRequestIn; - } - - /// - /// 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.GpuLimitRequestIn? 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.GpuLimitRequestIn), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitRequestIn; - } - - /// - /// 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.GpuLimitRequestIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs deleted file mode 100644 index 24075f93..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs +++ /dev/null @@ -1,64 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class GpuLimitRequestIn - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("gpu_type")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string GpuType { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("requested_limit")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int RequestedLimit { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("reason")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Reason { 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 GpuLimitRequestIn( - string gpuType, - int requestedLimit, - string reason) - { - this.GpuType = gpuType ?? throw new global::System.ArgumentNullException(nameof(gpuType)); - this.RequestedLimit = requestedLimit; - this.Reason = reason ?? throw new global::System.ArgumentNullException(nameof(reason)); - } - - /// - /// Initializes a new instance of the class. - /// - public GpuLimitRequestIn() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOut.Json.g.cs new file mode 100644 index 00000000..aee3c13b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOut), + jsonSerializerContext) as global::DeepInfra.GpuPoolOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOut.g.cs new file mode 100644 index 00000000..f0390024 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOut.g.cs @@ -0,0 +1,79 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolOut + { + /// + /// Effective GPU max per type (pool, 0 if unset) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_limits")] + public global::System.Collections.Generic.Dictionary? MaxLimits { get; set; } + + /// + /// Effective GPU min per type (pool, 0 if unset) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("min_limits")] + public global::System.Collections.Generic.Dictionary? MinLimits { get; set; } + + /// + /// Pending requested max per type + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pending_max_requests")] + public global::System.Collections.Generic.Dictionary? PendingMaxRequests { get; set; } + + /// + /// Pending requested min per type + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pending_min_requests")] + public global::System.Collections.Generic.Dictionary? PendingMinRequests { 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. + /// + /// + /// Effective GPU max per type (pool, 0 if unset) + /// + /// + /// Effective GPU min per type (pool, 0 if unset) + /// + /// + /// Pending requested max per type + /// + /// + /// Pending requested min per type + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GpuPoolOut( + global::System.Collections.Generic.Dictionary? maxLimits, + global::System.Collections.Generic.Dictionary? minLimits, + global::System.Collections.Generic.Dictionary? pendingMaxRequests, + global::System.Collections.Generic.Dictionary? pendingMinRequests) + { + this.MaxLimits = maxLimits; + this.MinLimits = minLimits; + this.PendingMaxRequests = pendingMaxRequests; + this.PendingMinRequests = pendingMinRequests; + } + + /// + /// Initializes a new instance of the class. + /// + public GpuPoolOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMaxLimits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMaxLimits.Json.g.cs new file mode 100644 index 00000000..74d4aa7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMaxLimits.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOutMaxLimits + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutMaxLimits? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOutMaxLimits), + jsonSerializerContext) as global::DeepInfra.GpuPoolOutMaxLimits; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutMaxLimits? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOutMaxLimits? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOutMaxLimits), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOutMaxLimits; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMaxLimits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMaxLimits.g.cs new file mode 100644 index 00000000..06bfd6a3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMaxLimits.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Effective GPU max per type (pool, 0 if unset) + /// + public sealed partial class GpuPoolOutMaxLimits + { + + /// + /// 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.GpuPoolOutMinLimits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMinLimits.Json.g.cs new file mode 100644 index 00000000..ecc56697 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMinLimits.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOutMinLimits + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutMinLimits? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOutMinLimits), + jsonSerializerContext) as global::DeepInfra.GpuPoolOutMinLimits; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutMinLimits? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOutMinLimits? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOutMinLimits), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOutMinLimits; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMinLimits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMinLimits.g.cs new file mode 100644 index 00000000..105bba45 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutMinLimits.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Effective GPU min per type (pool, 0 if unset) + /// + public sealed partial class GpuPoolOutMinLimits + { + + /// + /// 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.GpuPoolOutPendingMaxRequests.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests.Json.g.cs new file mode 100644 index 00000000..c105e4cd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOutPendingMaxRequests + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMaxRequests? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOutPendingMaxRequests), + jsonSerializerContext) as global::DeepInfra.GpuPoolOutPendingMaxRequests; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMaxRequests? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOutPendingMaxRequests? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOutPendingMaxRequests), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOutPendingMaxRequests; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests.g.cs new file mode 100644 index 00000000..5899ca2b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Pending requested max per type + /// + public sealed partial class GpuPoolOutPendingMaxRequests + { + + /// + /// 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.GpuPoolOutPendingMaxRequests2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests2.Json.g.cs new file mode 100644 index 00000000..1b5a5045 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOutPendingMaxRequests2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMaxRequests2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOutPendingMaxRequests2), + jsonSerializerContext) as global::DeepInfra.GpuPoolOutPendingMaxRequests2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMaxRequests2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOutPendingMaxRequests2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOutPendingMaxRequests2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOutPendingMaxRequests2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests2.g.cs new file mode 100644 index 00000000..359dd821 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMaxRequests2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolOutPendingMaxRequests2 + { + + /// + /// 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.GpuPoolOutPendingMinRequests.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests.Json.g.cs new file mode 100644 index 00000000..f04a3b7b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOutPendingMinRequests + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMinRequests? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOutPendingMinRequests), + jsonSerializerContext) as global::DeepInfra.GpuPoolOutPendingMinRequests; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMinRequests? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOutPendingMinRequests? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOutPendingMinRequests), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOutPendingMinRequests; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests.g.cs new file mode 100644 index 00000000..a2b9ad21 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Pending requested min per type + /// + public sealed partial class GpuPoolOutPendingMinRequests + { + + /// + /// 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.GpuPoolOutPendingMinRequests2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests2.Json.g.cs new file mode 100644 index 00000000..6b3c23f1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolOutPendingMinRequests2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMinRequests2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolOutPendingMinRequests2), + jsonSerializerContext) as global::DeepInfra.GpuPoolOutPendingMinRequests2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolOutPendingMinRequests2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolOutPendingMinRequests2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolOutPendingMinRequests2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolOutPendingMinRequests2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests2.g.cs new file mode 100644 index 00000000..ddea30be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolOutPendingMinRequests2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolOutPendingMinRequests2 + { + + /// + /// 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.GpuPoolRequestIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestIn.Json.g.cs new file mode 100644 index 00000000..5d30ae0e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolRequestIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolRequestIn), + jsonSerializerContext) as global::DeepInfra.GpuPoolRequestIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolRequestIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolRequestIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolRequestIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestIn.g.cs new file mode 100644 index 00000000..51eec9d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestIn.g.cs @@ -0,0 +1,63 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolRequestIn + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("reason")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Reason { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requested_min")] + public global::System.Collections.Generic.Dictionary? RequestedMin { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("requested_max")] + public global::System.Collections.Generic.Dictionary? RequestedMax { 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 GpuPoolRequestIn( + string reason, + global::System.Collections.Generic.Dictionary? requestedMin, + global::System.Collections.Generic.Dictionary? requestedMax) + { + this.Reason = reason ?? throw new global::System.ArgumentNullException(nameof(reason)); + this.RequestedMin = requestedMin; + this.RequestedMax = requestedMax; + } + + /// + /// Initializes a new instance of the class. + /// + public GpuPoolRequestIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax.Json.g.cs new file mode 100644 index 00000000..72a99a6e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolRequestInRequestedMax + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMax? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMax), + jsonSerializerContext) as global::DeepInfra.GpuPoolRequestInRequestedMax; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMax? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolRequestInRequestedMax? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMax), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolRequestInRequestedMax; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax.g.cs new file mode 100644 index 00000000..21243bb5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolRequestInRequestedMax + { + + /// + /// 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.GpuPoolRequestInRequestedMax2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax2.Json.g.cs new file mode 100644 index 00000000..135026aa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolRequestInRequestedMax2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMax2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMax2), + jsonSerializerContext) as global::DeepInfra.GpuPoolRequestInRequestedMax2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMax2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolRequestInRequestedMax2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMax2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolRequestInRequestedMax2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax2.g.cs new file mode 100644 index 00000000..790985a2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMax2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolRequestInRequestedMax2 + { + + /// + /// 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.GpuPoolRequestInRequestedMin.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin.Json.g.cs new file mode 100644 index 00000000..54b0b217 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolRequestInRequestedMin + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMin? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMin), + jsonSerializerContext) as global::DeepInfra.GpuPoolRequestInRequestedMin; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMin? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolRequestInRequestedMin? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMin), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolRequestInRequestedMin; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin.g.cs new file mode 100644 index 00000000..7fbebc41 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolRequestInRequestedMin + { + + /// + /// 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.GpuPoolRequestInRequestedMin2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin2.Json.g.cs new file mode 100644 index 00000000..4fb7ece4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuPoolRequestInRequestedMin2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMin2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMin2), + jsonSerializerContext) as global::DeepInfra.GpuPoolRequestInRequestedMin2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuPoolRequestInRequestedMin2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuPoolRequestInRequestedMin2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuPoolRequestInRequestedMin2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuPoolRequestInRequestedMin2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin2.g.cs new file mode 100644 index 00000000..1fa43fae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuPoolRequestInRequestedMin2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuPoolRequestInRequestedMin2 + { + + /// + /// 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.GpuTypesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuTypesOut.Json.g.cs new file mode 100644 index 00000000..570a2f2e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuTypesOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GpuTypesOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.GpuTypesOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GpuTypesOut), + jsonSerializerContext) as global::DeepInfra.GpuTypesOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuTypesOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.GpuTypesOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.GpuTypesOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuTypesOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuTypesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuTypesOut.g.cs new file mode 100644 index 00000000..a2ebc770 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuTypesOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GpuTypesOut + { + /// + /// GPU types to show in the pools UI, in display order. A guide, not a limit: a pool may hold types outside this list. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_types")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList GpuTypes { 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. + /// + /// + /// GPU types to show in the pools UI, in display order. A guide, not a limit: a pool may hold types outside this list. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GpuTypesOut( + global::System.Collections.Generic.IList gpuTypes) + { + this.GpuTypes = gpuTypes ?? throw new global::System.ArgumentNullException(nameof(gpuTypes)); + } + + /// + /// Initializes a new instance of the class. + /// + public GpuTypesOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.Json.g.cs index 4451f42f..66aec1a6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HFModel; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HFModel? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFModel; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs index 4260e924..8dfd8d96 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HFModel { @@ -53,5 +53,6 @@ public HFModel( public HFModel() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs deleted file mode 100644 index 55dd842c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class HFModelTask - { - /// - /// 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.HFModelTask? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.HFModelTask), - jsonSerializerContext) as global::DeepInfra.HFModelTask; - } - - /// - /// 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.HFModelTask? 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.HFModelTask), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFModelTask; - } - - /// - /// 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.HFModelTask.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs deleted file mode 100644 index 4506187e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Task - /// - public sealed partial class HFModelTask - { - - /// - /// 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.HFTasksE.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs index f51c8573..539c305e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs @@ -4,80 +4,112 @@ namespace DeepInfra { /// - /// + /// /// public enum HFTasksE { /// - /// + /// /// AutomaticSpeechRecognition, /// - /// + /// + /// + BareMetal, + /// + /// + /// + Cluster, + /// + /// + /// + Commitment, + /// + /// /// Custom, /// - /// + /// /// Dreambooth, /// - /// + /// /// Embeddings, /// - /// + /// /// FillMask, /// - /// + /// + /// + Hermes, + /// + /// /// ImageClassification, /// - /// + /// /// ObjectDetection, /// - /// + /// + /// + Openclaw, + /// + /// /// QuestionAnswering, /// - /// + /// /// RentContainer, /// - /// + /// /// Reranker, /// - /// + /// + /// + Sandbox, + /// + /// /// TextClassification, /// - /// + /// /// TextGeneration, /// - /// + /// /// TextToImage, /// - /// + /// + /// + TextToMusic, + /// + /// /// TextToSpeech, /// - /// + /// /// TextToVideo, /// - /// + /// /// Text2textGeneration, /// - /// + /// /// TokenClassification, /// - /// + /// + /// + WorldModel, + /// + /// /// ZeroShotImageClassification, } @@ -95,22 +127,30 @@ public static string ToValueString(this HFTasksE value) return value switch { HFTasksE.AutomaticSpeechRecognition => "automatic-speech-recognition", + HFTasksE.BareMetal => "bare-metal", + HFTasksE.Cluster => "cluster", + HFTasksE.Commitment => "commitment", HFTasksE.Custom => "custom", 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", + HFTasksE.Sandbox => "sandbox", HFTasksE.TextClassification => "text-classification", HFTasksE.TextGeneration => "text-generation", HFTasksE.TextToImage => "text-to-image", + HFTasksE.TextToMusic => "text-to-music", HFTasksE.TextToSpeech => "text-to-speech", 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), }; @@ -123,22 +163,30 @@ public static string ToValueString(this HFTasksE value) return value switch { "automatic-speech-recognition" => HFTasksE.AutomaticSpeechRecognition, + "bare-metal" => HFTasksE.BareMetal, + "cluster" => HFTasksE.Cluster, + "commitment" => HFTasksE.Commitment, "custom" => HFTasksE.Custom, "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, + "sandbox" => HFTasksE.Sandbox, "text-classification" => HFTasksE.TextClassification, "text-generation" => HFTasksE.TextGeneration, "text-to-image" => HFTasksE.TextToImage, + "text-to-music" => HFTasksE.TextToMusic, "text-to-speech" => HFTasksE.TextToSpeech, "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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.Json.g.cs index 41835949..83c2c423 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HFWeights; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HFWeights? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFWeights; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs index e9e91189..86526fa6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HFWeights { @@ -64,5 +64,6 @@ public HFWeights( public HFWeights() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs deleted file mode 100644 index d0ab535a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class HFWeightsRevision - { - /// - /// 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.HFWeightsRevision? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.HFWeightsRevision), - jsonSerializerContext) as global::DeepInfra.HFWeightsRevision; - } - - /// - /// 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.HFWeightsRevision? 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.HFWeightsRevision), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFWeightsRevision; - } - - /// - /// 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.HFWeightsRevision.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs deleted file mode 100644 index 8c4d177d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// commit sha or branch name - /// - public sealed partial class HFWeightsRevision - { - - /// - /// 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.HFWeightsToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.Json.g.cs deleted file mode 100644 index c5e338b6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class HFWeightsToken - { - /// - /// 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.HFWeightsToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.HFWeightsToken), - jsonSerializerContext) as global::DeepInfra.HFWeightsToken; - } - - /// - /// 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.HFWeightsToken? 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.HFWeightsToken), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFWeightsToken; - } - - /// - /// 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.HFWeightsToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs deleted file mode 100644 index 0d23a55c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// huggingface access token with read access to the repo - /// - public sealed partial class HFWeightsToken - { - - /// - /// 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.HTTPValidationError.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.Json.g.cs index 4b71afa9..10b59dd8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HTTPValidationError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HTTPValidationError? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HTTPValidationError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs index fe9d6bcf..004e23bd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HTTPValidationError { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("detail")] public global::System.Collections.Generic.IList? Detail { get; set; } @@ -39,5 +39,6 @@ public HTTPValidationError( public HTTPValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.Json.g.cs index a6d99ed9..1a09e519 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HardwareOption; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HardwareOption? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HardwareOption; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs index 6d355626..02e445f3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs @@ -4,26 +4,26 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HardwareOption { /// - /// + /// /// [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("type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.HardwareOptionTypeJsonConverter))] @@ -31,7 +31,7 @@ public sealed partial class HardwareOption public required global::DeepInfra.HardwareOptionType Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] @@ -72,5 +72,6 @@ public HardwareOption( public HardwareOption() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOptionType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOptionType.g.cs index 6e272b55..d2adb969 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOptionType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOptionType.g.cs @@ -4,16 +4,16 @@ namespace DeepInfra { /// - /// + /// /// public enum HardwareOptionType { /// - /// + /// /// Dedicated, /// - /// + /// /// Serverless, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.Json.g.cs index 5712e49a..8c7bcd2f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HardwarePricingDedicated; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HardwarePricingDedicated? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HardwarePricingDedicated; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs index 9e588890..a53a61d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HardwarePricingDedicated { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_minute")] [global::System.Text.Json.Serialization.JsonRequired] @@ -40,5 +40,6 @@ public HardwarePricingDedicated( public HardwarePricingDedicated() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.Json.g.cs index bbfb7b30..360e4d38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HardwarePricingServerless; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HardwarePricingServerless? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HardwarePricingServerless; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs index c4de72ea..3bc18f53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs @@ -4,24 +4,30 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HardwarePricingServerless { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_million_input_tokens")] [global::System.Text.Json.Serialization.JsonRequired] public required double CentsPerMillionInputTokens { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_million_output_tokens")] [global::System.Text.Json.Serialization.JsonRequired] public required double CentsPerMillionOutputTokens { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -33,15 +39,18 @@ public sealed partial class HardwarePricingServerless /// /// /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public HardwarePricingServerless( double centsPerMillionInputTokens, - double centsPerMillionOutputTokens) + double centsPerMillionOutputTokens, + double? discount) { this.CentsPerMillionInputTokens = centsPerMillionInputTokens; this.CentsPerMillionOutputTokens = centsPerMillionOutputTokens; + this.Discount = discount; } /// @@ -50,5 +59,6 @@ public HardwarePricingServerless( public HardwarePricingServerless() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.Json.g.cs index 953423e2..899375b7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HardwareResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HardwareResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HardwareResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs index 5166b437..17c741e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class HardwareResponse { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("hardware")] public global::System.Collections.Generic.IList? Hardware { get; set; } @@ -39,5 +39,6 @@ public HardwareResponse( public HardwareResponse() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.Json.g.cs index f45dbd27..3bea6cc5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ImageURL; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ImageURL? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ImageURL; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs index 02c951b0..e18f23ad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ImageURL { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] [global::System.Text.Json.Serialization.JsonRequired] @@ -52,5 +52,6 @@ public ImageURL( public ImageURL() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURLDetail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURLDetail.g.cs index cd599c8e..7a4c3141 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURLDetail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURLDetail.g.cs @@ -9,15 +9,15 @@ namespace DeepInfra public enum ImageURLDetail { /// - /// + /// /// Auto, /// - /// + /// /// High, /// - /// + /// /// Low, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.Json.g.cs index 51c32523..18e7cea2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs index dfe142fe..06f50de8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.Json.g.cs deleted file mode 100644 index bd7de055..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostXiApiKey - { - /// - /// 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.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey; - } - - /// - /// 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.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey? 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.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey; - } - - /// - /// 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.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs deleted file mode 100644 index 23e019fd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostXiApiKey - { - - /// - /// 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.InferenceModelV1InferenceModelNamePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.Json.g.cs index 8fd5e716..3e394cca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InferenceModelV1InferenceModelNamePostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceModelV1InferenceModelNamePostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceModelV1InferenceModelNamePostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs index 82363cf8..e60299e8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class InferenceModelV1InferenceModelNamePostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.Json.g.cs deleted file mode 100644 index 6ad5488d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class InferenceModelV1InferenceModelNamePostVersion - { - /// - /// 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.InferenceModelV1InferenceModelNamePostVersion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.InferenceModelV1InferenceModelNamePostVersion), - jsonSerializerContext) as global::DeepInfra.InferenceModelV1InferenceModelNamePostVersion; - } - - /// - /// 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.InferenceModelV1InferenceModelNamePostVersion? 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.InferenceModelV1InferenceModelNamePostVersion), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceModelV1InferenceModelNamePostVersion; - } - - /// - /// 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.InferenceModelV1InferenceModelNamePostVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs deleted file mode 100644 index 3c79cba5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// model version to run inference against - /// - public sealed partial class InferenceModelV1InferenceModelNamePostVersion - { - - /// - /// 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.InferenceModelV1InferenceModelNamePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.Json.g.cs deleted file mode 100644 index 964f6f22..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class InferenceModelV1InferenceModelNamePostXiApiKey - { - /// - /// 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.InferenceModelV1InferenceModelNamePostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.InferenceModelV1InferenceModelNamePostXiApiKey), - jsonSerializerContext) as global::DeepInfra.InferenceModelV1InferenceModelNamePostXiApiKey; - } - - /// - /// 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.InferenceModelV1InferenceModelNamePostXiApiKey? 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.InferenceModelV1InferenceModelNamePostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceModelV1InferenceModelNamePostXiApiKey; - } - - /// - /// 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.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs deleted file mode 100644 index 362ca8e3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class InferenceModelV1InferenceModelNamePostXiApiKey - { - - /// - /// 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.InputAudio.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.Json.g.cs index 6a5e7064..9095b546 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InputAudio; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InputAudio? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InputAudio; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs index 3eca8103..bf9e833b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class InputAudio { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("data")] [global::System.Text.Json.Serialization.JsonRequired] @@ -52,5 +52,6 @@ public InputAudio( public InputAudio() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudioFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudioFormat.g.cs index 251c7971..2c1cd99b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudioFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudioFormat.g.cs @@ -9,11 +9,11 @@ namespace DeepInfra public enum InputAudioFormat { /// - /// + /// /// Mp3, /// - /// + /// /// Wav, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputVariant2ItemVariant2Item.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputVariant2ItemVariant2Item.Json.g.cs new file mode 100644 index 00000000..decf9369 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputVariant2ItemVariant2Item.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public readonly partial struct InputVariant2ItemVariant2Item + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.InputVariant2ItemVariant2Item? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InputVariant2ItemVariant2Item), + jsonSerializerContext) as global::DeepInfra.InputVariant2ItemVariant2Item?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InputVariant2ItemVariant2Item? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.InputVariant2ItemVariant2Item? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.InputVariant2ItemVariant2Item), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InputVariant2ItemVariant2Item?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputVariant2ItemVariant2Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputVariant2ItemVariant2Item.g.cs new file mode 100644 index 00000000..f7b235a2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputVariant2ItemVariant2Item.g.cs @@ -0,0 +1,303 @@ +#pragma warning disable CS0618 // Type or member is obsolete + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public readonly partial struct InputVariant2ItemVariant2Item : global::System.IEquatable + { + /// + /// + /// + public global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? Type { get; } + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::DeepInfra.ChatCompletionContentPartText? Text { get; init; } +#else + public global::DeepInfra.ChatCompletionContentPartText? Text { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] +#endif + public bool IsText => Text != null; + + /// + /// + /// + public bool TryPickText( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::DeepInfra.ChatCompletionContentPartText? value) + { + value = Text; + return IsText; + } + + /// + /// + /// + public global::DeepInfra.ChatCompletionContentPartText PickText() => IsText + ? Text! + : throw new global::System.InvalidOperationException($"Expected union variant 'Text' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public global::DeepInfra.ChatCompletionContentPartImage? ImageUrl { get; init; } +#else + public global::DeepInfra.ChatCompletionContentPartImage? ImageUrl { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ImageUrl))] +#endif + public bool IsImageUrl => ImageUrl != null; + + /// + /// + /// + public bool TryPickImageUrl( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::DeepInfra.ChatCompletionContentPartImage? value) + { + value = ImageUrl; + return IsImageUrl; + } + + /// + /// + /// + public global::DeepInfra.ChatCompletionContentPartImage PickImageUrl() => IsImageUrl + ? ImageUrl! + : throw new global::System.InvalidOperationException($"Expected union variant 'ImageUrl' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator InputVariant2ItemVariant2Item(global::DeepInfra.ChatCompletionContentPartText value) => new InputVariant2ItemVariant2Item((global::DeepInfra.ChatCompletionContentPartText?)value); + + /// + /// + /// + public static implicit operator global::DeepInfra.ChatCompletionContentPartText?(InputVariant2ItemVariant2Item @this) => @this.Text; + + /// + /// + /// + public InputVariant2ItemVariant2Item(global::DeepInfra.ChatCompletionContentPartText? value) + { + Text = value; + } + + /// + /// + /// + public static InputVariant2ItemVariant2Item FromText(global::DeepInfra.ChatCompletionContentPartText? value) => new InputVariant2ItemVariant2Item(value); + + /// + /// + /// + public static implicit operator InputVariant2ItemVariant2Item(global::DeepInfra.ChatCompletionContentPartImage value) => new InputVariant2ItemVariant2Item((global::DeepInfra.ChatCompletionContentPartImage?)value); + + /// + /// + /// + public static implicit operator global::DeepInfra.ChatCompletionContentPartImage?(InputVariant2ItemVariant2Item @this) => @this.ImageUrl; + + /// + /// + /// + public InputVariant2ItemVariant2Item(global::DeepInfra.ChatCompletionContentPartImage? value) + { + ImageUrl = value; + } + + /// + /// + /// + public static InputVariant2ItemVariant2Item FromImageUrl(global::DeepInfra.ChatCompletionContentPartImage? value) => new InputVariant2ItemVariant2Item(value); + + /// + /// + /// + public InputVariant2ItemVariant2Item( + global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? type, + global::DeepInfra.ChatCompletionContentPartText? text, + global::DeepInfra.ChatCompletionContentPartImage? imageUrl + ) + { + Type = type; + + Text = text; + ImageUrl = imageUrl; + } + + /// + /// + /// + public object? Object => + ImageUrl as object ?? + Text as object + ; + + /// + /// + /// + public override string? ToString() => + Text?.ToString() ?? + ImageUrl?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsText && !IsImageUrl || !IsText && IsImageUrl; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? text = null, + global::System.Func? imageUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText && text != null) + { + return text(Text!); + } + else if (IsImageUrl && imageUrl != null) + { + return imageUrl(ImageUrl!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? text = null, + + global::System.Action? imageUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? text = null, + global::System.Action? imageUrl = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsText) + { + text?.Invoke(Text!); + } + else if (IsImageUrl) + { + imageUrl?.Invoke(ImageUrl!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Text, + typeof(global::DeepInfra.ChatCompletionContentPartText), + ImageUrl, + typeof(global::DeepInfra.ChatCompletionContentPartImage), + }; + 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(InputVariant2ItemVariant2Item other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(ImageUrl, other.ImageUrl) + ; + } + + /// + /// + /// + public static bool operator ==(InputVariant2ItemVariant2Item obj1, InputVariant2ItemVariant2Item obj2) + { + return global::System.Collections.Generic.EqualityComparer.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(InputVariant2ItemVariant2Item obj1, InputVariant2ItemVariant2Item obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is InputVariant2ItemVariant2Item o && Equals(o); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.Json.g.cs index 1d94f868..3fb02096 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InspectScopedJWTOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InspectScopedJWTOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJWTOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs index d320e831..9dc0cc86 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class InspectScopedJWTOut { @@ -65,5 +65,6 @@ public InspectScopedJWTOut( public InspectScopedJWTOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs deleted file mode 100644 index db11be93..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class InspectScopedJWTOutModels - { - /// - /// 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.InspectScopedJWTOutModels? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.InspectScopedJWTOutModels), - jsonSerializerContext) as global::DeepInfra.InspectScopedJWTOutModels; - } - - /// - /// 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.InspectScopedJWTOutModels? 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.InspectScopedJWTOutModels), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJWTOutModels; - } - - /// - /// 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.InspectScopedJWTOutModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs deleted file mode 100644 index 378b1840..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// which models is the token limited to - /// - public sealed partial class InspectScopedJWTOutModels - { - - /// - /// 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.InspectScopedJWTOutSpendingLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.Json.g.cs deleted file mode 100644 index 6ebd0c34..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class InspectScopedJWTOutSpendingLimit - { - /// - /// 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.InspectScopedJWTOutSpendingLimit? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.InspectScopedJWTOutSpendingLimit), - jsonSerializerContext) as global::DeepInfra.InspectScopedJWTOutSpendingLimit; - } - - /// - /// 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.InspectScopedJWTOutSpendingLimit? 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.InspectScopedJWTOutSpendingLimit), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJWTOutSpendingLimit; - } - - /// - /// 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.InspectScopedJWTOutSpendingLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs deleted file mode 100644 index ee4dc828..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// how much is the total spending limit set at creation - /// - public sealed partial class InspectScopedJWTOutSpendingLimit - { - - /// - /// 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.InspectScopedJwtV1ScopedJwtGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.Json.g.cs deleted file mode 100644 index 7d9be011..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class InspectScopedJwtV1ScopedJwtGetXiApiKey - { - /// - /// 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.InspectScopedJwtV1ScopedJwtGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXiApiKey; - } - - /// - /// 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.InspectScopedJwtV1ScopedJwtGetXiApiKey? 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.InspectScopedJwtV1ScopedJwtGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXiApiKey; - } - - /// - /// 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.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs deleted file mode 100644 index 8d108dc3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class InspectScopedJwtV1ScopedJwtGetXiApiKey - { - - /// - /// 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.InvoiceListItem.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs new file mode 100644 index 00000000..bafbda32 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItem? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.InvoiceListItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.InvoiceListItem), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItem; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..1371a1d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.g.cs @@ -0,0 +1,130 @@ + +#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("due_date")] + public int? DueDate { 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, + int? dueDate, + 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.DueDate = dueDate; + 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.InvoicesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs new file mode 100644 index 00000000..4472fb95 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoicesOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.InvoicesOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.InvoicesOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoicesOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..51f4bd21 --- /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.JsonObjectResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.Json.g.cs index 1b7dbffa..bb6b59ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.JsonObjectResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.JsonObjectResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.JsonObjectResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs index 42290083..48dae4b7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class JsonObjectResponseFormat { @@ -41,5 +41,6 @@ public JsonObjectResponseFormat( public JsonObjectResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.Json.g.cs index 05d5e0bd..45bbe923 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.JsonSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.JsonSchema? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.JsonSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs index e3fb1dea..b8e489ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class JsonSchema { @@ -54,5 +54,6 @@ public JsonSchema( public JsonSchema() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.Json.g.cs index 51a4b489..24a0da2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.JsonSchemaResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.JsonSchemaResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.JsonSchemaResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs index b32f2fb7..2c0076c6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class JsonSchemaResponseFormat { @@ -53,5 +53,6 @@ public JsonSchemaResponseFormat( public JsonSchemaResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.Json.g.cs index f9af3679..d20629f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.JsonSchemaSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.JsonSchemaSchema? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.JsonSchemaSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.Json.g.cs index 5ef26d27..24e989cf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LLMDeploymentStatsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LLMDeploymentStatsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LLMDeploymentStatsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs index 3638e6ba..5ef192bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class LLMDeploymentStatsOut { @@ -138,5 +138,6 @@ public LLMDeploymentStatsOut( public LLMDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs deleted file mode 100644 index e6cf20a5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1FilesGetAfter - { - /// - /// 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.ListFilesV1FilesGetAfter? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1FilesGetAfter), - jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetAfter; - } - - /// - /// 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.ListFilesV1FilesGetAfter? 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.ListFilesV1FilesGetAfter), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetAfter; - } - - /// - /// 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.ListFilesV1FilesGetAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs deleted file mode 100644 index 8624af92..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1FilesGetAfter - { - - /// - /// 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.ListFilesV1FilesGetOrder.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.Json.g.cs deleted file mode 100644 index e42fe349..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1FilesGetOrder - { - /// - /// 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.ListFilesV1FilesGetOrder? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1FilesGetOrder), - jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetOrder; - } - - /// - /// 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.ListFilesV1FilesGetOrder? 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.ListFilesV1FilesGetOrder), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetOrder; - } - - /// - /// 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.ListFilesV1FilesGetOrder.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs deleted file mode 100644 index eee9d300..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1FilesGetOrder - { - - /// - /// 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.ListFilesV1FilesGetPurpose.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.Json.g.cs deleted file mode 100644 index 2ff74c47..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1FilesGetPurpose - { - /// - /// 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.ListFilesV1FilesGetPurpose? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1FilesGetPurpose), - jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetPurpose; - } - - /// - /// 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.ListFilesV1FilesGetPurpose? 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.ListFilesV1FilesGetPurpose), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetPurpose; - } - - /// - /// 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.ListFilesV1FilesGetPurpose.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs deleted file mode 100644 index 7a174fd5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1FilesGetPurpose - { - - /// - /// 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.ListFilesV1FilesGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.Json.g.cs index 24a0f623..a92db50e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListFilesV1FilesGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs index 4b6b8222..f7e3ef9c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ListFilesV1FilesGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.Json.g.cs deleted file mode 100644 index 199b0c86..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1FilesGetXiApiKey - { - /// - /// 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.ListFilesV1FilesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1FilesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetXiApiKey; - } - - /// - /// 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.ListFilesV1FilesGetXiApiKey? 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.ListFilesV1FilesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetXiApiKey; - } - - /// - /// 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.ListFilesV1FilesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs deleted file mode 100644 index f02094fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1FilesGetXiApiKey - { - - /// - /// 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.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.ListInvoicesPaymentInvoicesGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs new file mode 100644 index 00000000..3e3c1d4e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetSession? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ListInvoicesPaymentInvoicesGetSession), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListInvoicesPaymentInvoicesGetSession; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..f60737ce --- /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.LogQueryOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.Json.g.cs index 3d394ae6..648bbecf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LogQueryOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LogQueryOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogQueryOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs index 1ab1ed22..9ad3e342 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class LogQueryOut { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.Json.g.cs deleted file mode 100644 index b306386b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class LogsQueryV1LogsQueryGetFrom - { - /// - /// 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.LogsQueryV1LogsQueryGetFrom? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.LogsQueryV1LogsQueryGetFrom), - jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetFrom; - } - - /// - /// 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.LogsQueryV1LogsQueryGetFrom? 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.LogsQueryV1LogsQueryGetFrom), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetFrom; - } - - /// - /// 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.LogsQueryV1LogsQueryGetFrom.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs deleted file mode 100644 index 5687f40e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - public sealed partial class LogsQueryV1LogsQueryGetFrom - { - - /// - /// 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.LogsQueryV1LogsQueryGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.Json.g.cs deleted file mode 100644 index 308d3ff1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class LogsQueryV1LogsQueryGetTo - { - /// - /// 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.LogsQueryV1LogsQueryGetTo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.LogsQueryV1LogsQueryGetTo), - jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetTo; - } - - /// - /// 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.LogsQueryV1LogsQueryGetTo? 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.LogsQueryV1LogsQueryGetTo), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetTo; - } - - /// - /// 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.LogsQueryV1LogsQueryGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs deleted file mode 100644 index 569935c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - public sealed partial class LogsQueryV1LogsQueryGetTo - { - - /// - /// 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.LogsQueryV1LogsQueryGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.Json.g.cs deleted file mode 100644 index a5f7c2c7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class LogsQueryV1LogsQueryGetXiApiKey - { - /// - /// 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.LogsQueryV1LogsQueryGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.LogsQueryV1LogsQueryGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetXiApiKey; - } - - /// - /// 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.LogsQueryV1LogsQueryGetXiApiKey? 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.LogsQueryV1LogsQueryGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetXiApiKey; - } - - /// - /// 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.LogsQueryV1LogsQueryGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs deleted file mode 100644 index 92d4a12f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class LogsQueryV1LogsQueryGetXiApiKey - { - - /// - /// 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.LoraModelUploadIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.Json.g.cs index ac0ec48a..b8239297 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LoraModelUploadIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LoraModelUploadIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LoraModelUploadIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs index 28e66cf0..e564d891 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs @@ -4,32 +4,32 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class LoraModelUploadIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("hf_model_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string HfModelName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("hf_token")] public string? HfToken { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("lora_model_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string LoraModelName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("base_model_name")] public string? BaseModelName { get; set; } @@ -68,5 +68,6 @@ public LoraModelUploadIn( public LoraModelUploadIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs deleted file mode 100644 index c75d176b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class LoraModelUploadInBaseModelName - { - /// - /// 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.LoraModelUploadInBaseModelName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.LoraModelUploadInBaseModelName), - jsonSerializerContext) as global::DeepInfra.LoraModelUploadInBaseModelName; - } - - /// - /// 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.LoraModelUploadInBaseModelName? 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.LoraModelUploadInBaseModelName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LoraModelUploadInBaseModelName; - } - - /// - /// 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.LoraModelUploadInBaseModelName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs deleted file mode 100644 index cac995cd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class LoraModelUploadInBaseModelName - { - - /// - /// 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.LoraModelUploadInHfToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.Json.g.cs deleted file mode 100644 index 5eb9b0c8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class LoraModelUploadInHfToken - { - /// - /// 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.LoraModelUploadInHfToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.LoraModelUploadInHfToken), - jsonSerializerContext) as global::DeepInfra.LoraModelUploadInHfToken; - } - - /// - /// 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.LoraModelUploadInHfToken? 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.LoraModelUploadInHfToken), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LoraModelUploadInHfToken; - } - - /// - /// 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.LoraModelUploadInHfToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs deleted file mode 100644 index 8f37377d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class LoraModelUploadInHfToken - { - - /// - /// 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.Me.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.Json.g.cs index 9c80fbd4..bcc440a9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.Me; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.Me? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.Me; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs index 47b6a4e7..2647fcb2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs @@ -4,32 +4,32 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class Me { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("uid")] [global::System.Text.Json.Serialization.JsonRequired] public required string Uid { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("email")] public string? Email { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("email_verified")] [global::System.Text.Json.Serialization.JsonRequired] public required bool EmailVerified { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("account_setup")] [global::System.Text.Json.Serialization.JsonRequired] @@ -56,18 +56,32 @@ public sealed partial class Me public required string Provider { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("picture")] public string? Picture { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("is_admin")] [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; } + + /// + /// Whether the user may use the sandboxes feature (available to all users)
+ /// Default Value: true + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("can_access_sandboxes")] + public bool? CanAccessSandboxes { get; set; } + /// /// Personal name /// @@ -97,7 +111,7 @@ public sealed partial class Me public required string Country { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("is_business_account")] [global::System.Text.Json.Serialization.JsonRequired] @@ -137,13 +151,13 @@ public sealed partial class Me public bool? IsTeamOwner { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("team_role")] public string? TeamRole { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("team_display_name")] public string? TeamDisplayName { get; set; } @@ -155,13 +169,27 @@ public sealed partial class Me public bool? IsTeamUpgradeEnabled { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("vercel_connection")] public global::DeepInfra.MeVercelConnection2? VercelConnection { get; set; } /// - /// + /// Whether a Google account is linked
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("google_linked")] + public bool? GoogleLinked { get; set; } + + /// + /// Frontend should route the user into the post-signup account-details form
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("show_signup_form")] + public bool? ShowSignupForm { get; set; } + + /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("checklist")] public global::DeepInfra.Checklist? Checklist { get; set; } @@ -212,6 +240,14 @@ 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 + /// + /// + /// Whether the user may use the sandboxes feature (available to all users)
+ /// Default Value: true + /// /// /// Default Value: false /// @@ -224,6 +260,14 @@ public sealed partial class Me /// Default Value: true /// /// + /// + /// Whether a Google account is linked
+ /// Default Value: false + /// + /// + /// Frontend should route the user into the post-signup account-details form
+ /// Default Value: false + /// /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] @@ -246,12 +290,16 @@ public Me( string? email, bool? requireEmailVerified, string? picture, + bool? canAccessAgents, + bool? canAccessSandboxes, bool? isTeamAccount, bool? isTeamOwner, string? teamRole, string? teamDisplayName, bool? isTeamUpgradeEnabled, global::DeepInfra.MeVercelConnection2? vercelConnection, + bool? googleLinked, + bool? showSignupForm, global::DeepInfra.Checklist? checklist) { this.Uid = uid ?? throw new global::System.ArgumentNullException(nameof(uid)); @@ -263,6 +311,8 @@ public Me( this.Provider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); this.Picture = picture; this.IsAdmin = isAdmin; + this.CanAccessAgents = canAccessAgents; + this.CanAccessSandboxes = canAccessSandboxes; 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)); @@ -277,6 +327,8 @@ public Me( this.TeamDisplayName = teamDisplayName; this.IsTeamUpgradeEnabled = isTeamUpgradeEnabled; this.VercelConnection = vercelConnection; + this.GoogleLinked = googleLinked; + this.ShowSignupForm = showSignupForm; this.Checklist = checklist; } @@ -286,5 +338,6 @@ public Me( public Me() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.Json.g.cs index 946dd443..ebbb6b29 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeChecklist; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeChecklist? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeChecklist; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs index fc0aa8fb..727eccdd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class MeChecklist { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.Json.g.cs deleted file mode 100644 index c3c9a053..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeEmail - { - /// - /// 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.MeEmail? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeEmail), - jsonSerializerContext) as global::DeepInfra.MeEmail; - } - - /// - /// 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.MeEmail? 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.MeEmail), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeEmail; - } - - /// - /// 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.MeEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs deleted file mode 100644 index 4f6d9c36..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeEmail - { - - /// - /// 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.MeIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.Json.g.cs index cabd72fe..b723e668 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs index d879549f..d6c1c85f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class MeIn { @@ -33,13 +33,13 @@ public sealed partial class MeIn public string? Country { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("email")] public string? Email { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("is_business_account")] public bool? IsBusinessAccount { get; set; } @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.Json.g.cs deleted file mode 100644 index 42ce62b2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInAttribution - { - /// - /// 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.MeInAttribution? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInAttribution), - jsonSerializerContext) as global::DeepInfra.MeInAttribution; - } - - /// - /// 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.MeInAttribution? 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.MeInAttribution), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInAttribution; - } - - /// - /// 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.MeInAttribution.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs deleted file mode 100644 index 8bf953d6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of how the user found out about DeepInfra - /// - public sealed partial class MeInAttribution - { - - /// - /// 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.MeInCompany.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.Json.g.cs deleted file mode 100644 index 626e4944..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInCompany - { - /// - /// 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.MeInCompany? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInCompany), - jsonSerializerContext) as global::DeepInfra.MeInCompany; - } - - /// - /// 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.MeInCompany? 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.MeInCompany), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInCompany; - } - - /// - /// 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.MeInCompany.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs deleted file mode 100644 index d81013ae..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Company name - /// - public sealed partial class MeInCompany - { - - /// - /// 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.MeInCountry.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.Json.g.cs deleted file mode 100644 index 81e225e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInCountry - { - /// - /// 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.MeInCountry? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInCountry), - jsonSerializerContext) as global::DeepInfra.MeInCountry; - } - - /// - /// 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.MeInCountry? 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.MeInCountry), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInCountry; - } - - /// - /// 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.MeInCountry.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs deleted file mode 100644 index 3db6a179..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Country of the user - /// - public sealed partial class MeInCountry - { - - /// - /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.Json.g.cs deleted file mode 100644 index 6fc33cc9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInDisplayName - { - /// - /// 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.MeInDisplayName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInDisplayName), - jsonSerializerContext) as global::DeepInfra.MeInDisplayName; - } - - /// - /// 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.MeInDisplayName? 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.MeInDisplayName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInDisplayName; - } - - /// - /// 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.MeInDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs deleted file mode 100644 index 239d2816..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - public sealed partial class MeInDisplayName - { - - /// - /// 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.MeInEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.Json.g.cs deleted file mode 100644 index e1dc55c7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInEmail - { - /// - /// 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.MeInEmail? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInEmail), - jsonSerializerContext) as global::DeepInfra.MeInEmail; - } - - /// - /// 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.MeInEmail? 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.MeInEmail), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInEmail; - } - - /// - /// 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.MeInEmail.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs deleted file mode 100644 index 9d1ba97b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeInEmail - { - - /// - /// 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.MeInFirstName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.Json.g.cs deleted file mode 100644 index a9e93634..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInFirstName - { - /// - /// 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.MeInFirstName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInFirstName), - jsonSerializerContext) as global::DeepInfra.MeInFirstName; - } - - /// - /// 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.MeInFirstName? 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.MeInFirstName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInFirstName; - } - - /// - /// 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.MeInFirstName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs deleted file mode 100644 index 8341e0be..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// First name of the user - /// - public sealed partial class MeInFirstName - { - - /// - /// 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.MeInIsBusinessAccount.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.Json.g.cs deleted file mode 100644 index f3f32b60..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInIsBusinessAccount - { - /// - /// 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.MeInIsBusinessAccount? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInIsBusinessAccount), - jsonSerializerContext) as global::DeepInfra.MeInIsBusinessAccount; - } - - /// - /// 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.MeInIsBusinessAccount? 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.MeInIsBusinessAccount), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInIsBusinessAccount; - } - - /// - /// 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.MeInIsBusinessAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs deleted file mode 100644 index 0c4bc7fd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeInIsBusinessAccount - { - - /// - /// 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.MeInLastName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.Json.g.cs deleted file mode 100644 index 0581e7e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInLastName - { - /// - /// 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.MeInLastName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInLastName), - jsonSerializerContext) as global::DeepInfra.MeInLastName; - } - - /// - /// 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.MeInLastName? 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.MeInLastName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInLastName; - } - - /// - /// 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.MeInLastName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs deleted file mode 100644 index c71a8e33..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Last name of the user - /// - public sealed partial class MeInLastName - { - - /// - /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.Json.g.cs deleted file mode 100644 index 7c0444dc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInName - { - /// - /// 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.MeInName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInName), - jsonSerializerContext) as global::DeepInfra.MeInName; - } - - /// - /// 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.MeInName? 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.MeInName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInName; - } - - /// - /// 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.MeInName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs deleted file mode 100644 index 44ae9219..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Personal name - /// - public sealed partial class MeInName - { - - /// - /// 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.MeInTitle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.Json.g.cs deleted file mode 100644 index 72eabcdb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInTitle - { - /// - /// 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.MeInTitle? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInTitle), - jsonSerializerContext) as global::DeepInfra.MeInTitle; - } - - /// - /// 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.MeInTitle? 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.MeInTitle), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInTitle; - } - - /// - /// 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.MeInTitle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs deleted file mode 100644 index 9e423b8d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Job title of the user, e.g. 'Software Engineer' - /// - public sealed partial class MeInTitle - { - - /// - /// 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.MeInUseCase.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.Json.g.cs deleted file mode 100644 index fa4f46a5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInUseCase - { - /// - /// 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.MeInUseCase? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInUseCase), - jsonSerializerContext) as global::DeepInfra.MeInUseCase; - } - - /// - /// 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.MeInUseCase? 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.MeInUseCase), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInUseCase; - } - - /// - /// 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.MeInUseCase.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs deleted file mode 100644 index 94405092..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the use case for the account - /// - public sealed partial class MeInUseCase - { - - /// - /// 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.MeInWebsite.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.Json.g.cs deleted file mode 100644 index 7a37a9ff..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeInWebsite - { - /// - /// 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.MeInWebsite? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeInWebsite), - jsonSerializerContext) as global::DeepInfra.MeInWebsite; - } - - /// - /// 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.MeInWebsite? 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.MeInWebsite), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInWebsite; - } - - /// - /// 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.MeInWebsite.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs deleted file mode 100644 index 18fd85a0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Company website address - /// - public sealed partial class MeInWebsite - { - - /// - /// 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.MePicture.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.Json.g.cs deleted file mode 100644 index 93eae3cd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MePicture - { - /// - /// 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.MePicture? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MePicture), - jsonSerializerContext) as global::DeepInfra.MePicture; - } - - /// - /// 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.MePicture? 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.MePicture), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MePicture; - } - - /// - /// 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.MePicture.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs deleted file mode 100644 index 4dfeca74..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MePicture - { - - /// - /// 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.MeTeamDisplayName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.Json.g.cs deleted file mode 100644 index 12c376e7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeTeamDisplayName - { - /// - /// 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.MeTeamDisplayName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeTeamDisplayName), - jsonSerializerContext) as global::DeepInfra.MeTeamDisplayName; - } - - /// - /// 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.MeTeamDisplayName? 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.MeTeamDisplayName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeTeamDisplayName; - } - - /// - /// 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.MeTeamDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs deleted file mode 100644 index ff7502ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeTeamDisplayName - { - - /// - /// 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.MeTeamRole.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.Json.g.cs deleted file mode 100644 index a82a5b95..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeTeamRole - { - /// - /// 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.MeTeamRole? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeTeamRole), - jsonSerializerContext) as global::DeepInfra.MeTeamRole; - } - - /// - /// 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.MeTeamRole? 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.MeTeamRole), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeTeamRole; - } - - /// - /// 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.MeTeamRole.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs deleted file mode 100644 index 4857d5bb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeTeamRole - { - - /// - /// 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.MeV1MeGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.Json.g.cs deleted file mode 100644 index 85bb4c9f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeV1MeGetXiApiKey - { - /// - /// 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.MeV1MeGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeV1MeGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.MeV1MeGetXiApiKey; - } - - /// - /// 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.MeV1MeGetXiApiKey? 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.MeV1MeGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeV1MeGetXiApiKey; - } - - /// - /// 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.MeV1MeGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs deleted file mode 100644 index 95a4d871..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeV1MeGetXiApiKey - { - - /// - /// 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.MeVercelConnection.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.Json.g.cs index 83b10748..2f16618e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeVercelConnection; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeVercelConnection? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeVercelConnection; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs index b2c7bee0..56a33c60 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class MeVercelConnection { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.Json.g.cs index 762e03b3..91022b5d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeVercelConnection2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeVercelConnection2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeVercelConnection2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs index c6eab454..255c0637 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs @@ -4,25 +4,25 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class MeVercelConnection2 { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string UserId { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("team_id")] public string? TeamId { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("installation_id")] [global::System.Text.Json.Serialization.JsonRequired] @@ -59,5 +59,6 @@ public MeVercelConnection2( public MeVercelConnection2() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs deleted file mode 100644 index 9c3fd98d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class MeVercelConnectionTeamId - { - /// - /// 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.MeVercelConnectionTeamId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.MeVercelConnectionTeamId), - jsonSerializerContext) as global::DeepInfra.MeVercelConnectionTeamId; - } - - /// - /// 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.MeVercelConnectionTeamId? 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.MeVercelConnectionTeamId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeVercelConnectionTeamId; - } - - /// - /// 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.MeVercelConnectionTeamId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs deleted file mode 100644 index 2ebba383..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class MeVercelConnectionTeamId - { - - /// - /// 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.ModelDeleteModelsModelNameDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.Json.g.cs index d7b780ba..2b98d7d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelDeleteModelsModelNameDeleteResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelDeleteModelsModelNameDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelDeleteModelsModelNameDeleteResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs index 66776586..7986f4d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelDeleteModelsModelNameDeleteResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.Json.g.cs deleted file mode 100644 index 2ba0f88d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelDeleteModelsModelNameDeleteXiApiKey - { - /// - /// 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.ModelDeleteModelsModelNameDeleteXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelDeleteModelsModelNameDeleteXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelDeleteModelsModelNameDeleteXiApiKey; - } - - /// - /// 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.ModelDeleteModelsModelNameDeleteXiApiKey? 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.ModelDeleteModelsModelNameDeleteXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelDeleteModelsModelNameDeleteXiApiKey; - } - - /// - /// 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.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs deleted file mode 100644 index 0f0d6fd2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelDeleteModelsModelNameDeleteXiApiKey - { - - /// - /// 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.ModelDocBlock.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.Json.g.cs index e2a39d4f..6e2b6793 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelDocBlock; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelDocBlock? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelDocBlock; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs index d4783e3a..7043e2e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelDocBlock { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("key")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.ModelDocBlockKeyJsonConverter))] @@ -17,7 +17,7 @@ public sealed partial class ModelDocBlock public required global::DeepInfra.ModelDocBlockKey Key { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] [global::System.Text.Json.Serialization.JsonRequired] @@ -51,5 +51,6 @@ public ModelDocBlock( public ModelDocBlock() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlockKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlockKey.g.cs index c035bf59..b073a012 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlockKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlockKey.g.cs @@ -4,232 +4,232 @@ namespace DeepInfra { /// - /// + /// /// public enum ModelDocBlockKey { /// - /// + /// /// AiSdkJs, /// - /// + /// /// AiSdkJsShort, /// - /// + /// /// CreateVoiceHttp, /// - /// + /// /// CreateVoiceJs, /// - /// + /// /// CreateVoicePython, /// - /// + /// /// Deepctl, /// - /// + /// /// DeleteVoiceHttp, /// - /// + /// /// DeleteVoiceJs, /// - /// + /// /// DeleteVoicePython, /// - /// + /// /// ElevenlabsTtsHttp, /// - /// + /// /// ElevenlabsTtsJs, /// - /// + /// /// ElevenlabsTtsPython, /// - /// + /// /// Http, /// - /// + /// /// HttpBagelMultimodal, /// - /// + /// /// HttpBgeM3Multimodal, /// - /// + /// /// JsEmb, /// - /// + /// /// JsSpeechToText, /// - /// + /// /// JsTextGen, /// - /// + /// /// JsTextToImg, /// - /// + /// /// ListVoicesHttp, /// - /// + /// /// ListVoicesJs, /// - /// + /// /// ListVoicesPython, /// - /// + /// /// OpenaiCompHttp, /// - /// + /// /// OpenaiCompJs, /// - /// + /// /// OpenaiCompJsShort, /// - /// + /// /// OpenaiCompPython, /// - /// + /// /// OpenaiCompPythonShort, /// - /// + /// /// OpenaiEmbHttp, /// - /// + /// /// OpenaiEmbJs, /// - /// + /// /// OpenaiEmbPy, /// - /// + /// /// OpenaiHttp, /// - /// + /// /// OpenaiImagesEditsHttp, /// - /// + /// /// OpenaiImagesEditsJs, /// - /// + /// /// OpenaiImagesEditsPython, /// - /// + /// /// OpenaiImagesHttp, /// - /// + /// /// OpenaiImagesJs, /// - /// + /// /// OpenaiImagesPython, /// - /// + /// /// OpenaiImagesVariationsHttp, /// - /// + /// /// OpenaiImagesVariationsJs, /// - /// + /// /// OpenaiImagesVariationsPython, /// - /// + /// /// OpenaiJs, /// - /// + /// /// OpenaiJsShort, /// - /// + /// /// OpenaiPython, /// - /// + /// /// OpenaiPythonShort, /// - /// + /// /// OpenaiSpeechHttp, /// - /// + /// /// OpenaiSpeechJs, /// - /// + /// /// OpenaiSpeechPython, /// - /// + /// /// OpenaiTtsHttp, /// - /// + /// /// OpenaiTtsJs, /// - /// + /// /// OpenaiTtsPython, /// - /// + /// /// ReadVoiceHttp, /// - /// + /// /// ReadVoiceJs, /// - /// + /// /// ReadVoicePython, /// - /// + /// /// UpdateVoiceHttp, /// - /// + /// /// UpdateVoiceJs, /// - /// + /// /// UpdateVoicePython, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.Json.g.cs index 153ceef7..e7a516dc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFamilyOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFamilyOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFamilyOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs index 5a97e4fc..2341f836 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelFamilyOut { @@ -49,14 +49,14 @@ public sealed partial class ModelFamilyOut public string? MetaDescription { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("featured_models")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList FeaturedModels { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pp_sections_out")] [global::System.Text.Json.Serialization.JsonRequired] @@ -131,5 +131,6 @@ public ModelFamilyOut( public ModelFamilyOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs deleted file mode 100644 index fd344703..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFamilyOutMetaDescription - { - /// - /// 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.ModelFamilyOutMetaDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFamilyOutMetaDescription), - jsonSerializerContext) as global::DeepInfra.ModelFamilyOutMetaDescription; - } - - /// - /// 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.ModelFamilyOutMetaDescription? 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.ModelFamilyOutMetaDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFamilyOutMetaDescription; - } - - /// - /// 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.ModelFamilyOutMetaDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs deleted file mode 100644 index 2128156b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Meta description for SEO - /// - public sealed partial class ModelFamilyOutMetaDescription - { - - /// - /// 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.ModelFamilyOutMetaTitle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.Json.g.cs deleted file mode 100644 index fdde59ee..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFamilyOutMetaTitle - { - /// - /// 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.ModelFamilyOutMetaTitle? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFamilyOutMetaTitle), - jsonSerializerContext) as global::DeepInfra.ModelFamilyOutMetaTitle; - } - - /// - /// 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.ModelFamilyOutMetaTitle? 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.ModelFamilyOutMetaTitle), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFamilyOutMetaTitle; - } - - /// - /// 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.ModelFamilyOutMetaTitle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs deleted file mode 100644 index f3e09eca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Meta title for SEO - /// - public sealed partial class ModelFamilyOutMetaTitle - { - - /// - /// 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.ModelFieldInfo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.Json.g.cs index 73b71836..dc961bfa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs index 7b40f0ab..5e647550 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs @@ -4,44 +4,44 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelFieldInfo { /// - /// + /// /// [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("parent")] public string? Parent { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("ftype")] [global::System.Text.Json.Serialization.JsonRequired] public required string Ftype { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("description")] public string? Description { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("allowed")] public global::System.Collections.Generic.IList? Allowed { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("default")] public object? Default { get; set; } @@ -53,25 +53,25 @@ public sealed partial class ModelFieldInfo public global::System.Collections.Generic.IList? Examples { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("minimum")] public double? Minimum { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("exclusiveMinimum")] public double? ExclusiveMinimum { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("maximum")] public double? Maximum { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("exclusiveMaximum")] public double? ExclusiveMaximum { get; set; } @@ -133,5 +133,6 @@ public ModelFieldInfo( public ModelFieldInfo() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs deleted file mode 100644 index 6d37a119..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoAllowed - { - /// - /// 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.ModelFieldInfoAllowed? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoAllowed), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoAllowed; - } - - /// - /// 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.ModelFieldInfoAllowed? 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.ModelFieldInfoAllowed), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoAllowed; - } - - /// - /// 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.ModelFieldInfoAllowed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs deleted file mode 100644 index 29e96b12..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoAllowed - { - - /// - /// 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.ModelFieldInfoAllowedVariant1Item.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.Json.g.cs index 1f35c6e3..3305b849 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoAllowedVariant1Item; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoAllowedVariant1Item? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoAllowedVariant1Item; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs index 525e59ba..95ba8500 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelFieldInfoAllowedVariant1Item { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.Json.g.cs index d5a7e0f5..c8c6dde1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoDefault; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoDefault? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoDefault; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs index c333e6fb..185ad071 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelFieldInfoDefault { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.Json.g.cs deleted file mode 100644 index c4d04d25..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoDescription - { - /// - /// 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.ModelFieldInfoDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoDescription), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoDescription; - } - - /// - /// 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.ModelFieldInfoDescription? 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.ModelFieldInfoDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoDescription; - } - - /// - /// 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.ModelFieldInfoDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs deleted file mode 100644 index a62238ba..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoDescription - { - - /// - /// 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.ModelFieldInfoExample.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.Json.g.cs index c8d33ff8..6ad1a384 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoExample; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoExample? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoExample; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs index 480f2662..bdf71e6f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelFieldInfoExample { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.Json.g.cs deleted file mode 100644 index e82a6476..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoExclusiveMaximum - { - /// - /// 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.ModelFieldInfoExclusiveMaximum? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoExclusiveMaximum), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoExclusiveMaximum; - } - - /// - /// 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.ModelFieldInfoExclusiveMaximum? 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.ModelFieldInfoExclusiveMaximum), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoExclusiveMaximum; - } - - /// - /// 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.ModelFieldInfoExclusiveMaximum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs deleted file mode 100644 index 7ae1451b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoExclusiveMaximum - { - - /// - /// 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.ModelFieldInfoExclusiveMinimum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.Json.g.cs deleted file mode 100644 index deee3e61..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoExclusiveMinimum - { - /// - /// 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.ModelFieldInfoExclusiveMinimum? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoExclusiveMinimum), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoExclusiveMinimum; - } - - /// - /// 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.ModelFieldInfoExclusiveMinimum? 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.ModelFieldInfoExclusiveMinimum), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoExclusiveMinimum; - } - - /// - /// 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.ModelFieldInfoExclusiveMinimum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs deleted file mode 100644 index 55e31282..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoExclusiveMinimum - { - - /// - /// 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.ModelFieldInfoMaximum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.Json.g.cs deleted file mode 100644 index fa8c1721..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoMaximum - { - /// - /// 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.ModelFieldInfoMaximum? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoMaximum), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoMaximum; - } - - /// - /// 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.ModelFieldInfoMaximum? 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.ModelFieldInfoMaximum), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoMaximum; - } - - /// - /// 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.ModelFieldInfoMaximum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs deleted file mode 100644 index 0a24b053..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoMaximum - { - - /// - /// 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.ModelFieldInfoMinimum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.Json.g.cs deleted file mode 100644 index f25851a6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoMinimum - { - /// - /// 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.ModelFieldInfoMinimum? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoMinimum), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoMinimum; - } - - /// - /// 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.ModelFieldInfoMinimum? 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.ModelFieldInfoMinimum), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoMinimum; - } - - /// - /// 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.ModelFieldInfoMinimum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs deleted file mode 100644 index b5a00584..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoMinimum - { - - /// - /// 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.ModelFieldInfoParent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.Json.g.cs deleted file mode 100644 index b27336e5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelFieldInfoParent - { - /// - /// 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.ModelFieldInfoParent? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelFieldInfoParent), - jsonSerializerContext) as global::DeepInfra.ModelFieldInfoParent; - } - - /// - /// 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.ModelFieldInfoParent? 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.ModelFieldInfoParent), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoParent; - } - - /// - /// 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.ModelFieldInfoParent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs deleted file mode 100644 index 92117148..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelFieldInfoParent - { - - /// - /// 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.ModelInfoOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.Json.g.cs index 7d2e76b2..94dee7d7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs index 12ff1be9..282f9221 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs @@ -4,59 +4,59 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelInfoOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string ModelName { get; set; } /// - /// + /// /// [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("tags")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Tags { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("reported_type")] [global::System.Text.Json.Serialization.JsonRequired] public required string ReportedType { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("version")] [global::System.Text.Json.Serialization.JsonRequired] public required string Version { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("description")] public string? Description { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("mf_description")] public string? MfDescription { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("featured")] [global::System.Text.Json.Serialization.JsonRequired] @@ -69,93 +69,87 @@ public sealed partial class ModelInfoOut public bool? Owner { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("public")] [global::System.Text.Json.Serialization.JsonRequired] public required bool Public { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("curl_inv")] [global::System.Text.Json.Serialization.JsonRequired] public required string CurlInv { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cmdline_inv")] [global::System.Text.Json.Serialization.JsonRequired] public required string CmdlineInv { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("txt_docs")] [global::System.Text.Json.Serialization.JsonRequired] public required string TxtDocs { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("out_example")] [global::System.Text.Json.Serialization.JsonRequired] public required string OutExample { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("out_docs")] [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; } - - /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("in_schema")] public object? InSchema { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("out_schema")] public object? OutSchema { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("in_fields")] public global::System.Collections.Generic.IList? InFields { get; set; } /// - /// + /// /// [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; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("doc_blocks")] public global::System.Collections.Generic.IList? DocBlocks { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("short_doc_block")] public global::DeepInfra.ModelDocBlock? ShortDocBlock { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("schemas")] [global::System.Text.Json.Serialization.JsonRequired] @@ -168,49 +162,49 @@ public sealed partial class ModelInfoOut public object? Meta { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] public int? MaxTokens { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("max_output_tokens")] public int? MaxOutputTokens { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("replaced_by")] public string? ReplacedBy { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("deprecated")] public int? Deprecated { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] public string? Quantization { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("mmlu")] public double? Mmlu { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("expected")] public string? Expected { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("import_time")] public string? ImportTime { get; set; } @@ -228,13 +222,13 @@ public sealed partial class ModelInfoOut public bool? IsCustomDeployable { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("mf_name")] public string? MfName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("mf_title")] public string? MfTitle { 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.Json.g.cs deleted file mode 100644 index 3a75657c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutDeprecated - { - /// - /// 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.ModelInfoOutDeprecated? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutDeprecated), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutDeprecated; - } - - /// - /// 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.ModelInfoOutDeprecated? 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.ModelInfoOutDeprecated), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutDeprecated; - } - - /// - /// 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.ModelInfoOutDeprecated.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs deleted file mode 100644 index e131cc55..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutDeprecated - { - - /// - /// 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.ModelInfoOutDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.Json.g.cs deleted file mode 100644 index b26d2573..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutDescription - { - /// - /// 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.ModelInfoOutDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutDescription), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutDescription; - } - - /// - /// 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.ModelInfoOutDescription? 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.ModelInfoOutDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutDescription; - } - - /// - /// 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.ModelInfoOutDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs deleted file mode 100644 index d0865c18..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutDescription - { - - /// - /// 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.ModelInfoOutDocBlocks.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.Json.g.cs deleted file mode 100644 index 994834e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutDocBlocks - { - /// - /// 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.ModelInfoOutDocBlocks? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutDocBlocks), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutDocBlocks; - } - - /// - /// 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.ModelInfoOutDocBlocks? 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.ModelInfoOutDocBlocks), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutDocBlocks; - } - - /// - /// 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.ModelInfoOutDocBlocks.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs deleted file mode 100644 index 4b06fefb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutDocBlocks - { - - /// - /// 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.ModelInfoOutExpected.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.Json.g.cs deleted file mode 100644 index 765beb49..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutExpected - { - /// - /// 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.ModelInfoOutExpected? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutExpected), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutExpected; - } - - /// - /// 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.ModelInfoOutExpected? 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.ModelInfoOutExpected), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutExpected; - } - - /// - /// 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.ModelInfoOutExpected.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs deleted file mode 100644 index 35b64ef2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutExpected - { - - /// - /// 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.ModelInfoOutImportTime.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.Json.g.cs deleted file mode 100644 index cc2cf112..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutImportTime - { - /// - /// 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.ModelInfoOutImportTime? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutImportTime), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutImportTime; - } - - /// - /// 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.ModelInfoOutImportTime? 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.ModelInfoOutImportTime), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutImportTime; - } - - /// - /// 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.ModelInfoOutImportTime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs deleted file mode 100644 index e719e8b5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutImportTime - { - - /// - /// 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.ModelInfoOutInFields.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.Json.g.cs deleted file mode 100644 index e608c2c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutInFields - { - /// - /// 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.ModelInfoOutInFields? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutInFields), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutInFields; - } - - /// - /// 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.ModelInfoOutInFields? 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.ModelInfoOutInFields), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutInFields; - } - - /// - /// 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.ModelInfoOutInFields.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs deleted file mode 100644 index 1f527ce3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutInFields - { - - /// - /// 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.ModelInfoOutInSchema.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.Json.g.cs index 18698a45..e77bf6b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutInSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutInSchema? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutInSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs index 80cf6644..a79f4d2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelInfoOutInSchema { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.Json.g.cs deleted file mode 100644 index ddd2b9d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMaxOutputTokens - { - /// - /// 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.ModelInfoOutMaxOutputTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMaxOutputTokens), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMaxOutputTokens; - } - - /// - /// 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.ModelInfoOutMaxOutputTokens? 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.ModelInfoOutMaxOutputTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMaxOutputTokens; - } - - /// - /// 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.ModelInfoOutMaxOutputTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs deleted file mode 100644 index 25ce807f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMaxOutputTokens - { - - /// - /// 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.ModelInfoOutMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.Json.g.cs deleted file mode 100644 index 286e2b33..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMaxTokens - { - /// - /// 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.ModelInfoOutMaxTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMaxTokens), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMaxTokens; - } - - /// - /// 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.ModelInfoOutMaxTokens? 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.ModelInfoOutMaxTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMaxTokens; - } - - /// - /// 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.ModelInfoOutMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs deleted file mode 100644 index b326525a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMaxTokens - { - - /// - /// 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.ModelInfoOutMeta.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.Json.g.cs index ad928b92..c5690d3d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMeta? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.Json.g.cs deleted file mode 100644 index 35fa7cf1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMfDescription - { - /// - /// 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.ModelInfoOutMfDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMfDescription), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMfDescription; - } - - /// - /// 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.ModelInfoOutMfDescription? 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.ModelInfoOutMfDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMfDescription; - } - - /// - /// 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.ModelInfoOutMfDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs deleted file mode 100644 index ad334b76..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMfDescription - { - - /// - /// 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.ModelInfoOutMfName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.Json.g.cs deleted file mode 100644 index a5fe85b5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMfName - { - /// - /// 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.ModelInfoOutMfName? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMfName), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMfName; - } - - /// - /// 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.ModelInfoOutMfName? 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.ModelInfoOutMfName), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMfName; - } - - /// - /// 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.ModelInfoOutMfName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs deleted file mode 100644 index 161b812e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMfName - { - - /// - /// 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.ModelInfoOutMfTitle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.Json.g.cs deleted file mode 100644 index 9a9dc340..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMfTitle - { - /// - /// 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.ModelInfoOutMfTitle? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMfTitle), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMfTitle; - } - - /// - /// 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.ModelInfoOutMfTitle? 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.ModelInfoOutMfTitle), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMfTitle; - } - - /// - /// 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.ModelInfoOutMfTitle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs deleted file mode 100644 index dfd93934..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMfTitle - { - - /// - /// 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.ModelInfoOutMmlu.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.Json.g.cs deleted file mode 100644 index be5bc26b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMmlu - { - /// - /// 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.ModelInfoOutMmlu? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMmlu), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMmlu; - } - - /// - /// 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.ModelInfoOutMmlu? 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.ModelInfoOutMmlu), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMmlu; - } - - /// - /// 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.ModelInfoOutMmlu.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs deleted file mode 100644 index 6fe164ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMmlu - { - - /// - /// 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.ModelInfoOutOutSchema.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.Json.g.cs index 497deded..7241353b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutOutSchema; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutOutSchema? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutOutSchema; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs index e69500cb..b07e3026 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelInfoOutOutSchema { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.Json.g.cs deleted file mode 100644 index 66e07821..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutQuantization - { - /// - /// 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.ModelInfoOutQuantization? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutQuantization), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutQuantization; - } - - /// - /// 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.ModelInfoOutQuantization? 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.ModelInfoOutQuantization), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutQuantization; - } - - /// - /// 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.ModelInfoOutQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs deleted file mode 100644 index 883b0832..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutQuantization - { - - /// - /// 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.ModelInfoOutReplacedBy.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.Json.g.cs deleted file mode 100644 index b624c6ac..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutReplacedBy - { - /// - /// 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.ModelInfoOutReplacedBy? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutReplacedBy), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutReplacedBy; - } - - /// - /// 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.ModelInfoOutReplacedBy? 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.ModelInfoOutReplacedBy), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutReplacedBy; - } - - /// - /// 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.ModelInfoOutReplacedBy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs deleted file mode 100644 index 0c9f9f43..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutReplacedBy - { - - /// - /// 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.ModelInfoOutShortDocBlock.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.Json.g.cs index f9da5bd9..18e69922 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutShortDocBlock; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutShortDocBlock? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutShortDocBlock; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs index 716cf061..9d01cc88 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelInfoOutShortDocBlock { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.Json.g.cs index 0160defb..a24560d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMeta? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs index 1270252d..f3f56452 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs @@ -4,33 +4,33 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelMeta { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("provider")] [global::System.Text.Json.Serialization.JsonRequired] public required string Provider { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string ModelName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("task")] [global::System.Text.Json.Serialization.JsonRequired] public required string Task { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("plan_id")] public string? PlanId { get; set; } @@ -41,6 +41,12 @@ public sealed partial class ModelMeta [global::System.Text.Json.Serialization.JsonPropertyName("private")] public bool? Private { get; set; } + /// + /// bare-metal contract description, shown like on invoices + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contract")] + public string? Contract { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -57,6 +63,9 @@ public sealed partial class ModelMeta /// /// Default Value: false /// + /// + /// bare-metal contract description, shown like on invoices + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -65,13 +74,15 @@ public ModelMeta( string modelName, string task, string? planId, - bool? @private) + bool? @private, + string? contract) { this.Provider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); this.Task = task ?? throw new global::System.ArgumentNullException(nameof(task)); this.PlanId = planId; this.Private = @private; + this.Contract = contract; } /// @@ -80,5 +91,6 @@ public ModelMeta( public ModelMeta() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.Json.g.cs index 11773b55..ab62b629 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs index 85d04121..3d5e397d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelMetaIn { @@ -44,6 +44,12 @@ public sealed partial class ModelMetaIn [global::System.Text.Json.Serialization.JsonPropertyName("cover_img_url")] public string? CoverImgUrl { get; set; } + /// + /// dataurl or regular url to a sample of this model's output, shown on the model page before the first run (empty to delete) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sample_output_url")] + public string? SampleOutputUrl { get; set; } + /// /// model type /// @@ -77,6 +83,9 @@ public sealed partial class ModelMetaIn /// /// dataurl or regular url to cover image (empty to delete) /// + /// + /// dataurl or regular url to a sample of this model's output, shown on the model page before the first run (empty to delete) + /// /// /// model type /// @@ -90,6 +99,7 @@ public ModelMetaIn( string? licenseUrl, string? readme, string? coverImgUrl, + string? sampleOutputUrl, global::DeepInfra.HFTasksE? reportedType) { this.Description = description; @@ -98,6 +108,7 @@ public ModelMetaIn( this.LicenseUrl = licenseUrl; this.Readme = readme; this.CoverImgUrl = coverImgUrl; + this.SampleOutputUrl = sampleOutputUrl; this.ReportedType = reportedType; } @@ -107,5 +118,6 @@ public ModelMetaIn( public ModelMetaIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs deleted file mode 100644 index 069ab975..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInCoverImgUrl - { - /// - /// 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.ModelMetaInCoverImgUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInCoverImgUrl), - jsonSerializerContext) as global::DeepInfra.ModelMetaInCoverImgUrl; - } - - /// - /// 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.ModelMetaInCoverImgUrl? 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.ModelMetaInCoverImgUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInCoverImgUrl; - } - - /// - /// 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.ModelMetaInCoverImgUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs deleted file mode 100644 index 3bd0bc55..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// dataurl or regular url to cover image (empty to delete) - /// - public sealed partial class ModelMetaInCoverImgUrl - { - - /// - /// 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.ModelMetaInDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.Json.g.cs deleted file mode 100644 index 68535d5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInDescription - { - /// - /// 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.ModelMetaInDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInDescription), - jsonSerializerContext) as global::DeepInfra.ModelMetaInDescription; - } - - /// - /// 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.ModelMetaInDescription? 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.ModelMetaInDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInDescription; - } - - /// - /// 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.ModelMetaInDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs deleted file mode 100644 index 9781ca4a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// short model description in plain text - /// - public sealed partial class ModelMetaInDescription - { - - /// - /// 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.ModelMetaInGithubUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.Json.g.cs deleted file mode 100644 index 29d235b3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInGithubUrl - { - /// - /// 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.ModelMetaInGithubUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInGithubUrl), - jsonSerializerContext) as global::DeepInfra.ModelMetaInGithubUrl; - } - - /// - /// 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.ModelMetaInGithubUrl? 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.ModelMetaInGithubUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInGithubUrl; - } - - /// - /// 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.ModelMetaInGithubUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs deleted file mode 100644 index 012fee59..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// source code project link (empty to delete) - /// - public sealed partial class ModelMetaInGithubUrl - { - - /// - /// 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.ModelMetaInLicenseUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.Json.g.cs deleted file mode 100644 index 59e721f0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInLicenseUrl - { - /// - /// 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.ModelMetaInLicenseUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInLicenseUrl), - jsonSerializerContext) as global::DeepInfra.ModelMetaInLicenseUrl; - } - - /// - /// 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.ModelMetaInLicenseUrl? 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.ModelMetaInLicenseUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInLicenseUrl; - } - - /// - /// 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.ModelMetaInLicenseUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs deleted file mode 100644 index 649ced18..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// usage license link (empty to delete) - /// - public sealed partial class ModelMetaInLicenseUrl - { - - /// - /// 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.ModelMetaInPaperUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.Json.g.cs deleted file mode 100644 index 9edcf3e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInPaperUrl - { - /// - /// 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.ModelMetaInPaperUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInPaperUrl), - jsonSerializerContext) as global::DeepInfra.ModelMetaInPaperUrl; - } - - /// - /// 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.ModelMetaInPaperUrl? 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.ModelMetaInPaperUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInPaperUrl; - } - - /// - /// 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.ModelMetaInPaperUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs deleted file mode 100644 index bf51cb9d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// paper/research link (empty to delete) - /// - public sealed partial class ModelMetaInPaperUrl - { - - /// - /// 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.ModelMetaInReadme.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.Json.g.cs deleted file mode 100644 index a6f008e6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInReadme - { - /// - /// 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.ModelMetaInReadme? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInReadme), - jsonSerializerContext) as global::DeepInfra.ModelMetaInReadme; - } - - /// - /// 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.ModelMetaInReadme? 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.ModelMetaInReadme), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInReadme; - } - - /// - /// 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.ModelMetaInReadme.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs deleted file mode 100644 index 572deaba..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// markdown flavored model readme - /// - public sealed partial class ModelMetaInReadme - { - - /// - /// 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.ModelMetaInReportedType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.Json.g.cs deleted file mode 100644 index 004182ad..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaInReportedType - { - /// - /// 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.ModelMetaInReportedType? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaInReportedType), - jsonSerializerContext) as global::DeepInfra.ModelMetaInReportedType; - } - - /// - /// 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.ModelMetaInReportedType? 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.ModelMetaInReportedType), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInReportedType; - } - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.Json.g.cs deleted file mode 100644 index 6661854b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaPlanId - { - /// - /// 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.ModelMetaPlanId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaPlanId), - jsonSerializerContext) as global::DeepInfra.ModelMetaPlanId; - } - - /// - /// 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.ModelMetaPlanId? 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.ModelMetaPlanId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaPlanId; - } - - /// - /// 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.ModelMetaPlanId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs deleted file mode 100644 index b1778cff..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelMetaPlanId - { - - /// - /// 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.ModelMetaUpdateModelsModelNameMetaPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.Json.g.cs index 22d45040..d43851d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs index 834f71be..05fe73ce 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelMetaUpdateModelsModelNameMetaPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.Json.g.cs deleted file mode 100644 index c2946ed8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelMetaUpdateModelsModelNameMetaPostXiApiKey - { - /// - /// 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.ModelMetaUpdateModelsModelNameMetaPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXiApiKey; - } - - /// - /// 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.ModelMetaUpdateModelsModelNameMetaPostXiApiKey? 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.ModelMetaUpdateModelsModelNameMetaPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXiApiKey; - } - - /// - /// 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.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs deleted file mode 100644 index d09bda81..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelMetaUpdateModelsModelNameMetaPostXiApiKey - { - - /// - /// 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.ModelMetadata.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.Json.g.cs index 335e3d28..85202ade 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetadata; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadata? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadata; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs index d9b0f627..006d6ea6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs @@ -4,45 +4,77 @@ 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 { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("description")] [global::System.Text.Json.Serialization.JsonRequired] public required string Description { get; set; } /// - /// + /// /// [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; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.Dictionary Pricing { get; set; } /// - /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tags")] [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 +85,37 @@ 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, + double? discount, + 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.Discount = discount; this.Tags = tags ?? throw new global::System.ArgumentNullException(nameof(tags)); + this.DefaultWidth = defaultWidth; + this.DefaultHeight = defaultHeight; + this.DefaultIterations = defaultIterations; } /// @@ -80,5 +124,6 @@ public ModelMetadata( public ModelMetadata() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.Json.g.cs index efe43d22..0dbba14f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetadataPricing; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataPricing? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataPricing; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs index 2e843adf..ff442587 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelMetadataPricing { @@ -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..85ce1310 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelNameSuggestionOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ModelNameSuggestionOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ModelNameSuggestionOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelNameSuggestionOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..00d3d72f --- /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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.Json.g.cs index c819a5b6..57c05741 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs index a0df104f..d2afddb7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelOut { @@ -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 @@ -62,35 +62,41 @@ public sealed partial class ModelOut public int? MaxTokens { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("replaced_by")] public string? ReplacedBy { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("deprecated")] public int? Deprecated { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] public string? Quantization { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("mmlu")] public double? Mmlu { get; set; } /// - /// + /// /// [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.ModelOutDeprecated.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.Json.g.cs deleted file mode 100644 index 9c884ed6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelOutDeprecated - { - /// - /// 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.ModelOutDeprecated? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelOutDeprecated), - jsonSerializerContext) as global::DeepInfra.ModelOutDeprecated; - } - - /// - /// 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.ModelOutDeprecated? 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.ModelOutDeprecated), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutDeprecated; - } - - /// - /// 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.ModelOutDeprecated.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs deleted file mode 100644 index 7d8c2b68..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelOutDeprecated - { - - /// - /// 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.ModelOutExpected.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.Json.g.cs deleted file mode 100644 index cf947f93..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelOutExpected - { - /// - /// 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.ModelOutExpected? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelOutExpected), - jsonSerializerContext) as global::DeepInfra.ModelOutExpected; - } - - /// - /// 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.ModelOutExpected? 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.ModelOutExpected), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutExpected; - } - - /// - /// 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.ModelOutExpected.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs deleted file mode 100644 index 47b3f562..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelOutExpected - { - - /// - /// 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.ModelOutMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.Json.g.cs deleted file mode 100644 index b66a6cd8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelOutMaxTokens - { - /// - /// 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.ModelOutMaxTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelOutMaxTokens), - jsonSerializerContext) as global::DeepInfra.ModelOutMaxTokens; - } - - /// - /// 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.ModelOutMaxTokens? 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.ModelOutMaxTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutMaxTokens; - } - - /// - /// 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.ModelOutMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs deleted file mode 100644 index 2f17ab82..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The maximum context size of this model, if applicable - /// - public sealed partial class ModelOutMaxTokens - { - - /// - /// 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.ModelOutMmlu.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.Json.g.cs deleted file mode 100644 index 49849d58..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelOutMmlu - { - /// - /// 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.ModelOutMmlu? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelOutMmlu), - jsonSerializerContext) as global::DeepInfra.ModelOutMmlu; - } - - /// - /// 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.ModelOutMmlu? 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.ModelOutMmlu), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutMmlu; - } - - /// - /// 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.ModelOutMmlu.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs deleted file mode 100644 index dd88e584..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelOutMmlu - { - - /// - /// 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.ModelOutQuantization.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.Json.g.cs deleted file mode 100644 index 15dfa5ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelOutQuantization - { - /// - /// 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.ModelOutQuantization? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelOutQuantization), - jsonSerializerContext) as global::DeepInfra.ModelOutQuantization; - } - - /// - /// 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.ModelOutQuantization? 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.ModelOutQuantization), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutQuantization; - } - - /// - /// 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.ModelOutQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs deleted file mode 100644 index 296b5a3d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelOutQuantization - { - - /// - /// 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.ModelOutReplacedBy.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.Json.g.cs deleted file mode 100644 index 86da16b1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelOutReplacedBy - { - /// - /// 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.ModelOutReplacedBy? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelOutReplacedBy), - jsonSerializerContext) as global::DeepInfra.ModelOutReplacedBy; - } - - /// - /// 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.ModelOutReplacedBy? 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.ModelOutReplacedBy), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutReplacedBy; - } - - /// - /// 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.ModelOutReplacedBy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs deleted file mode 100644 index 6e7d3478..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelOutReplacedBy - { - - /// - /// 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.ModelPricingFrameUnits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs new file mode 100644 index 00000000..242573b3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnits? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ModelPricingFrameUnits? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ModelPricingFrameUnits), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnits; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..278cda20 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.g.cs @@ -0,0 +1,111 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingFrameUnits + { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + + /// + /// 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. + /// + /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + /// + /// 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, + double? discount, + int? discountEndsAt, + string? @short, + string? full, + object? table, + string? type) + { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; + 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.ModelPricingFrameUnitsTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs new file mode 100644 index 00000000..67c1f89b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ModelPricingFrameUnitsTable? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ModelPricingFrameUnitsTable), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsTable; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..7dde87ac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ModelPricingFrameUnitsTable2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ModelPricingFrameUnitsTable2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsTable2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..49040fad --- /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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.Json.g.cs index ed9f86b3..e49f6193 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnits; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingImageUnits? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnits; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs index 2592a077..9c49031a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingImageUnits { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,41 +45,41 @@ public sealed partial class ModelPricingImageUnits public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_image_unit")] [global::System.Text.Json.Serialization.JsonRequired] public required double CentsPerImageUnit { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("default_width")] [global::System.Text.Json.Serialization.JsonRequired] public required int DefaultWidth { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("default_height")] [global::System.Text.Json.Serialization.JsonRequired] public required int DefaultHeight { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("default_iterations")] [global::System.Text.Json.Serialization.JsonRequired] public required int DefaultIterations { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("default_price_cents")] public double? DefaultPriceCents { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("usage_from_cost")] [global::System.Text.Json.Serialization.JsonRequired] @@ -87,6 +99,12 @@ public sealed partial class ModelPricingImageUnits /// /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -109,12 +127,16 @@ public ModelPricingImageUnits( int defaultHeight, int defaultIterations, bool usageFromCost, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type, double? defaultPriceCents) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -133,5 +155,6 @@ public ModelPricingImageUnits( public ModelPricingImageUnits() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs deleted file mode 100644 index 26d2ddb1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingImageUnitsDefaultPriceCents - { - /// - /// 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.ModelPricingImageUnitsDefaultPriceCents? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingImageUnitsDefaultPriceCents), - jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsDefaultPriceCents; - } - - /// - /// 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.ModelPricingImageUnitsDefaultPriceCents? 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.ModelPricingImageUnitsDefaultPriceCents), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsDefaultPriceCents; - } - - /// - /// 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.ModelPricingImageUnitsDefaultPriceCents.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs deleted file mode 100644 index 47f1bc1c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelPricingImageUnitsDefaultPriceCents - { - - /// - /// 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.ModelPricingImageUnitsFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.Json.g.cs deleted file mode 100644 index 067b7127..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingImageUnitsFull - { - /// - /// 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.ModelPricingImageUnitsFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingImageUnitsFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsFull; - } - - /// - /// 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.ModelPricingImageUnitsFull? 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.ModelPricingImageUnitsFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsFull; - } - - /// - /// 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.ModelPricingImageUnitsFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs deleted file mode 100644 index 1989728c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingImageUnitsFull - { - - /// - /// 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.ModelPricingImageUnitsShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.Json.g.cs deleted file mode 100644 index 4aed0763..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingImageUnitsShort - { - /// - /// 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.ModelPricingImageUnitsShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingImageUnitsShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsShort; - } - - /// - /// 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.ModelPricingImageUnitsShort? 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.ModelPricingImageUnitsShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsShort; - } - - /// - /// 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.ModelPricingImageUnitsShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs deleted file mode 100644 index eff3ef73..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingImageUnitsShort - { - - /// - /// 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.ModelPricingImageUnitsTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.Json.g.cs index 60a7ad51..d80c6a6d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingImageUnitsTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.Json.g.cs index b4cbec5b..14d8882c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingImageUnitsTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs index 4bbcf2cb..833c5482 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingImageUnitsTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.Json.g.cs index 8523ac28..620a9e0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLength; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputCharacterLength? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLength; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs index e56a7995..cf33a124 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingInputCharacterLength { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,7 +45,7 @@ public sealed partial class ModelPricingInputCharacterLength public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_input_chars")] [global::System.Text.Json.Serialization.JsonRequired] @@ -49,6 +61,12 @@ public sealed partial class ModelPricingInputCharacterLength /// Initializes a new instance of the class. /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -66,11 +84,15 @@ public sealed partial class ModelPricingInputCharacterLength #endif public ModelPricingInputCharacterLength( double centsPerInputChars, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -84,5 +106,6 @@ public ModelPricingInputCharacterLength( public ModelPricingInputCharacterLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs deleted file mode 100644 index ed491051..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingInputCharacterLengthFull - { - /// - /// 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.ModelPricingInputCharacterLengthFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingInputCharacterLengthFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLengthFull; - } - - /// - /// 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.ModelPricingInputCharacterLengthFull? 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.ModelPricingInputCharacterLengthFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLengthFull; - } - - /// - /// 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.ModelPricingInputCharacterLengthFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs deleted file mode 100644 index b420d138..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingInputCharacterLengthFull - { - - /// - /// 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.ModelPricingInputCharacterLengthShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.Json.g.cs deleted file mode 100644 index 2e6f124b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingInputCharacterLengthShort - { - /// - /// 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.ModelPricingInputCharacterLengthShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingInputCharacterLengthShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLengthShort; - } - - /// - /// 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.ModelPricingInputCharacterLengthShort? 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.ModelPricingInputCharacterLengthShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLengthShort; - } - - /// - /// 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.ModelPricingInputCharacterLengthShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs deleted file mode 100644 index 94aed5ed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingInputCharacterLengthShort - { - - /// - /// 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.ModelPricingInputCharacterLengthTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.Json.g.cs index 327d8e07..d450ba27 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLengthTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputCharacterLengthTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLengthTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.Json.g.cs index 1dd43bbf..bb3c91e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLengthTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputCharacterLengthTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLengthTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs index 68a91c7b..38562c34 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingInputCharacterLengthTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.Json.g.cs index 3fdb5a4d..ef909dbf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputLength; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputLength? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLength; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs index 3bda351f..35d49cdf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingInputLength { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,7 +45,7 @@ public sealed partial class ModelPricingInputLength public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_input_sec")] [global::System.Text.Json.Serialization.JsonRequired] @@ -49,6 +61,12 @@ public sealed partial class ModelPricingInputLength /// Initializes a new instance of the class. /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -66,11 +84,15 @@ public sealed partial class ModelPricingInputLength #endif public ModelPricingInputLength( double centsPerInputSec, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -84,5 +106,6 @@ public ModelPricingInputLength( public ModelPricingInputLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs deleted file mode 100644 index 1d0ba7f9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingInputLengthFull - { - /// - /// 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.ModelPricingInputLengthFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingInputLengthFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingInputLengthFull; - } - - /// - /// 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.ModelPricingInputLengthFull? 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.ModelPricingInputLengthFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLengthFull; - } - - /// - /// 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.ModelPricingInputLengthFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs deleted file mode 100644 index 9e951b8c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingInputLengthFull - { - - /// - /// 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.ModelPricingInputLengthShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.Json.g.cs deleted file mode 100644 index b3a12438..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingInputLengthShort - { - /// - /// 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.ModelPricingInputLengthShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingInputLengthShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingInputLengthShort; - } - - /// - /// 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.ModelPricingInputLengthShort? 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.ModelPricingInputLengthShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLengthShort; - } - - /// - /// 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.ModelPricingInputLengthShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs deleted file mode 100644 index 5d517e47..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingInputLengthShort - { - - /// - /// 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.ModelPricingInputLengthTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.Json.g.cs index 22c80da3..9e0efdcf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputLengthTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputLengthTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLengthTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.Json.g.cs index 18d8fcab..d5f5c9cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputLengthTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputLengthTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLengthTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs index 4cd403ff..b3bff342 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingInputLengthTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.Json.g.cs index 04fa446f..7dd65dde 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs index 9861207b..be9ec32d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingInputTokens { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,7 +45,7 @@ public sealed partial class ModelPricingInputTokens public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_input_token")] [global::System.Text.Json.Serialization.JsonRequired] @@ -49,6 +61,12 @@ public sealed partial class ModelPricingInputTokens /// Initializes a new instance of the class. /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -66,11 +84,15 @@ public sealed partial class ModelPricingInputTokens #endif public ModelPricingInputTokens( double centsPerInputToken, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -84,5 +106,6 @@ public ModelPricingInputTokens( public ModelPricingInputTokens() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs deleted file mode 100644 index 48b1998c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingInputTokensFull - { - /// - /// 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.ModelPricingInputTokensFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingInputTokensFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokensFull; - } - - /// - /// 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.ModelPricingInputTokensFull? 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.ModelPricingInputTokensFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokensFull; - } - - /// - /// 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.ModelPricingInputTokensFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs deleted file mode 100644 index 1cdf4a6d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingInputTokensFull - { - - /// - /// 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.ModelPricingInputTokensShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.Json.g.cs deleted file mode 100644 index 8747f507..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingInputTokensShort - { - /// - /// 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.ModelPricingInputTokensShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingInputTokensShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokensShort; - } - - /// - /// 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.ModelPricingInputTokensShort? 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.ModelPricingInputTokensShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokensShort; - } - - /// - /// 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.ModelPricingInputTokensShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs deleted file mode 100644 index 95aea410..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingInputTokensShort - { - - /// - /// 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.ModelPricingInputTokensTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.Json.g.cs index 71cd0978..5d242491 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokensTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputTokensTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokensTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.Json.g.cs index 69da0eb9..c1d40b66 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokensTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputTokensTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokensTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs index a8d96311..0f452b21 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingInputTokensTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.Json.g.cs index 497355c3..8fccd0ef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLength; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingOutputLength? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLength; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs index 8da9aeec..bf37a8cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingOutputLength { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,7 +45,7 @@ public sealed partial class ModelPricingOutputLength public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_output_sec")] [global::System.Text.Json.Serialization.JsonRequired] @@ -49,6 +61,12 @@ public sealed partial class ModelPricingOutputLength /// Initializes a new instance of the class. /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -66,11 +84,15 @@ public sealed partial class ModelPricingOutputLength #endif public ModelPricingOutputLength( double centsPerOutputSec, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -84,5 +106,6 @@ public ModelPricingOutputLength( public ModelPricingOutputLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs deleted file mode 100644 index 8ac79796..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingOutputLengthFull - { - /// - /// 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.ModelPricingOutputLengthFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingOutputLengthFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLengthFull; - } - - /// - /// 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.ModelPricingOutputLengthFull? 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.ModelPricingOutputLengthFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLengthFull; - } - - /// - /// 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.ModelPricingOutputLengthFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs deleted file mode 100644 index c87e9e9a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingOutputLengthFull - { - - /// - /// 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.ModelPricingOutputLengthShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.Json.g.cs deleted file mode 100644 index 49eb648d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingOutputLengthShort - { - /// - /// 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.ModelPricingOutputLengthShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingOutputLengthShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLengthShort; - } - - /// - /// 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.ModelPricingOutputLengthShort? 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.ModelPricingOutputLengthShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLengthShort; - } - - /// - /// 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.ModelPricingOutputLengthShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs deleted file mode 100644 index 8de949dc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingOutputLengthShort - { - - /// - /// 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.ModelPricingOutputLengthTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.Json.g.cs index b41b2726..87cc178c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLengthTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingOutputLengthTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLengthTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.Json.g.cs index 2c22a2f8..5b34a7e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLengthTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingOutputLengthTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLengthTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs index 658ccca7..b14a94f2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingOutputLengthTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.Json.g.cs index 042aee2c..d8a3e157 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTime; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTime? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTime; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs index db26957b..c7b74cc0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingTime { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,7 +45,7 @@ public sealed partial class ModelPricingTime public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_sec")] [global::System.Text.Json.Serialization.JsonRequired] @@ -49,6 +61,12 @@ public sealed partial class ModelPricingTime /// Initializes a new instance of the class. /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -66,11 +84,15 @@ public sealed partial class ModelPricingTime #endif public ModelPricingTime( double centsPerSec, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -84,5 +106,6 @@ public ModelPricingTime( public ModelPricingTime() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs deleted file mode 100644 index 0a24ea25..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingTimeFull - { - /// - /// 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.ModelPricingTimeFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingTimeFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingTimeFull; - } - - /// - /// 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.ModelPricingTimeFull? 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.ModelPricingTimeFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTimeFull; - } - - /// - /// 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.ModelPricingTimeFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs deleted file mode 100644 index 20a609d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingTimeFull - { - - /// - /// 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.ModelPricingTimeShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.Json.g.cs deleted file mode 100644 index b15139d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingTimeShort - { - /// - /// 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.ModelPricingTimeShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingTimeShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingTimeShort; - } - - /// - /// 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.ModelPricingTimeShort? 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.ModelPricingTimeShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTimeShort; - } - - /// - /// 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.ModelPricingTimeShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs deleted file mode 100644 index 35a5fd37..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingTimeShort - { - - /// - /// 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.ModelPricingTimeTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.Json.g.cs index 540975ea..08a8b547 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTimeTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTimeTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTimeTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.Json.g.cs index 7334c959..6dc7a055 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTimeTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTimeTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTimeTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs index 2442c079..6bcb171c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingTimeTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.Json.g.cs index af665229..5247e265 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs index a3f1fbd1..f070a82f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingTokens { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,31 +45,55 @@ public sealed partial class ModelPricingTokens public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_input_token")] [global::System.Text.Json.Serialization.JsonRequired] public required double CentsPerInputToken { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_output_token")] [global::System.Text.Json.Serialization.JsonRequired] public required double CentsPerOutputToken { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("rate_per_input_token_cached")] public double? RatePerInputTokenCached { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("rate_per_input_token_cache_write")] public double? RatePerInputTokenCacheWrite { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate_per_service_tier_priority")] + public double? RatePerServiceTierPriority { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate_per_service_tier_flex")] + public double? RatePerServiceTierFlex { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("rate_per_explicit_cache_write_token")] + public global::System.Collections.Generic.Dictionary? RatePerExplicitCacheWriteToken { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("explicit_cache_granularity_tokens")] + public int? ExplicitCacheGranularityTokens { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -69,6 +105,12 @@ public sealed partial class ModelPricingTokens /// /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -83,19 +125,31 @@ public sealed partial class ModelPricingTokens /// /// /// + /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ModelPricingTokens( double centsPerInputToken, double centsPerOutputToken, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type, double? ratePerInputTokenCached, - double? ratePerInputTokenCacheWrite) + double? ratePerInputTokenCacheWrite, + double? ratePerServiceTierPriority, + double? ratePerServiceTierFlex, + global::System.Collections.Generic.Dictionary? ratePerExplicitCacheWriteToken, + int? explicitCacheGranularityTokens) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -104,6 +158,10 @@ public ModelPricingTokens( this.CentsPerOutputToken = centsPerOutputToken; this.RatePerInputTokenCached = ratePerInputTokenCached; this.RatePerInputTokenCacheWrite = ratePerInputTokenCacheWrite; + this.RatePerServiceTierPriority = ratePerServiceTierPriority; + this.RatePerServiceTierFlex = ratePerServiceTierFlex; + this.RatePerExplicitCacheWriteToken = ratePerExplicitCacheWriteToken; + this.ExplicitCacheGranularityTokens = explicitCacheGranularityTokens; } /// @@ -112,5 +170,6 @@ public ModelPricingTokens( public ModelPricingTokens() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs deleted file mode 100644 index 5aa0c127..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingTokensFull - { - /// - /// 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.ModelPricingTokensFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingTokensFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingTokensFull; - } - - /// - /// 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.ModelPricingTokensFull? 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.ModelPricingTokensFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensFull; - } - - /// - /// 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.ModelPricingTokensFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs deleted file mode 100644 index 78b2d75f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingTokensFull - { - - /// - /// 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.ModelPricingTokensRatePerExplicitCacheWriteToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken.Json.g.cs new file mode 100644 index 00000000..ed3f3150 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingTokensRatePerExplicitCacheWriteToken + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken), + jsonSerializerContext) as global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken.g.cs new file mode 100644 index 00000000..195d87dc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingTokensRatePerExplicitCacheWriteToken + { + + /// + /// 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.ModelPricingTokensRatePerExplicitCacheWriteToken2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken2.Json.g.cs new file mode 100644 index 00000000..9965dfba --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingTokensRatePerExplicitCacheWriteToken2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2), + jsonSerializerContext) as global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensRatePerExplicitCacheWriteToken2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken2.g.cs new file mode 100644 index 00000000..c35259d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerExplicitCacheWriteToken2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingTokensRatePerExplicitCacheWriteToken2 + { + + /// + /// 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.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs deleted file mode 100644 index c4c24bb6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingTokensRatePerInputTokenCacheWrite - { - /// - /// 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.ModelPricingTokensRatePerInputTokenCacheWrite? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingTokensRatePerInputTokenCacheWrite), - jsonSerializerContext) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCacheWrite; - } - - /// - /// 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.ModelPricingTokensRatePerInputTokenCacheWrite? 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.ModelPricingTokensRatePerInputTokenCacheWrite), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCacheWrite; - } - - /// - /// 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.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs deleted file mode 100644 index 16b435a3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelPricingTokensRatePerInputTokenCacheWrite - { - - /// - /// 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.ModelPricingTokensRatePerInputTokenCached.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.Json.g.cs deleted file mode 100644 index bebd9d7b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingTokensRatePerInputTokenCached - { - /// - /// 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.ModelPricingTokensRatePerInputTokenCached? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingTokensRatePerInputTokenCached), - jsonSerializerContext) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCached; - } - - /// - /// 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.ModelPricingTokensRatePerInputTokenCached? 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.ModelPricingTokensRatePerInputTokenCached), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCached; - } - - /// - /// 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.ModelPricingTokensRatePerInputTokenCached.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs deleted file mode 100644 index 7ab1fb8a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelPricingTokensRatePerInputTokenCached - { - - /// - /// 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.ModelPricingTokensShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.Json.g.cs deleted file mode 100644 index b9afd1ad..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingTokensShort - { - /// - /// 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.ModelPricingTokensShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingTokensShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingTokensShort; - } - - /// - /// 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.ModelPricingTokensShort? 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.ModelPricingTokensShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensShort; - } - - /// - /// 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.ModelPricingTokensShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs deleted file mode 100644 index 7bf44e66..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingTokensShort - { - - /// - /// 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.ModelPricingTokensTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.Json.g.cs index 864da3d4..73896047 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokensTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.Json.g.cs index fa1cb305..f7c3fdfd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokensTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs index 552eaf32..a29b1dc7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingTokensTable2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.Json.g.cs index f67150ae..a3e372ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingUptime; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingUptime? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptime; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs index 5a6b7976..dc38b92f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs @@ -4,10 +4,22 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingUptime { + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount")] + public double? Discount { get; set; } + + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// + [global::System.Text.Json.Serialization.JsonPropertyName("discount_ends_at")] + public int? DiscountEndsAt { get; set; } + /// /// Short description of the pricing, ideal for cards and headers /// @@ -33,7 +45,7 @@ public sealed partial class ModelPricingUptime public string? Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_sec")] [global::System.Text.Json.Serialization.JsonRequired] @@ -49,6 +61,12 @@ public sealed partial class ModelPricingUptime /// Initializes a new instance of the class. /// /// + /// + /// Promotional discount; you are charged price * (1 - discount) + /// + /// + /// Unix timestamp (seconds) when the discount ends, null when it has no scheduled end + /// /// /// Short description of the pricing, ideal for cards and headers /// @@ -66,11 +84,15 @@ public sealed partial class ModelPricingUptime #endif public ModelPricingUptime( double centsPerSec, + double? discount, + int? discountEndsAt, string? @short, string? full, object? table, string? type) { + this.Discount = discount; + this.DiscountEndsAt = discountEndsAt; this.Short = @short; this.Full = full; this.Table = table; @@ -84,5 +106,6 @@ public ModelPricingUptime( public ModelPricingUptime() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs deleted file mode 100644 index e508212b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingUptimeFull - { - /// - /// 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.ModelPricingUptimeFull? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingUptimeFull), - jsonSerializerContext) as global::DeepInfra.ModelPricingUptimeFull; - } - - /// - /// 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.ModelPricingUptimeFull? 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.ModelPricingUptimeFull), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptimeFull; - } - - /// - /// 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.ModelPricingUptimeFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs deleted file mode 100644 index ae56eef8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Full description of the pricing, perfect for details - /// - public sealed partial class ModelPricingUptimeFull - { - - /// - /// 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.ModelPricingUptimeShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.Json.g.cs deleted file mode 100644 index 8b4b9132..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPricingUptimeShort - { - /// - /// 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.ModelPricingUptimeShort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPricingUptimeShort), - jsonSerializerContext) as global::DeepInfra.ModelPricingUptimeShort; - } - - /// - /// 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.ModelPricingUptimeShort? 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.ModelPricingUptimeShort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptimeShort; - } - - /// - /// 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.ModelPricingUptimeShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs deleted file mode 100644 index 05516964..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Short description of the pricing, ideal for cards and headers - /// - public sealed partial class ModelPricingUptimeShort - { - - /// - /// 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.ModelPricingUptimeTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.Json.g.cs index f1261b79..227dda2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingUptimeTable; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingUptimeTable? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptimeTable; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.Json.g.cs index 4d5ffbe8..a89fa41c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingUptimeTable2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingUptimeTable2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptimeTable2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs index 7b2a3df6..7ee2af25 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPricingUptimeTable2 { @@ -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.ModelProvider.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelProvider.g.cs index 8e021291..15959d40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelProvider.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelProvider.g.cs @@ -4,20 +4,20 @@ namespace DeepInfra { /// - /// + /// /// public enum ModelProvider { /// - /// + /// /// Cnt, /// - /// + /// /// Deepinfra, /// - /// + /// /// Huggingface, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.Json.g.cs index 20d615da..6e6772c8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPublicityIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPublicityIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPublicityIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs index e5ef54ec..50e5ac70 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPublicityIn { @@ -42,5 +42,6 @@ public ModelPublicityIn( public ModelPublicityIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.Json.g.cs index a82bee61..5b088c38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPublicityModelsModelNamePublicityPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs index 2533a30d..0b03cfa3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelPublicityModelsModelNamePublicityPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.Json.g.cs deleted file mode 100644 index ccfa5296..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelPublicityModelsModelNamePublicityPostXiApiKey - { - /// - /// 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.ModelPublicityModelsModelNamePublicityPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXiApiKey; - } - - /// - /// 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.ModelPublicityModelsModelNamePublicityPostXiApiKey? 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.ModelPublicityModelsModelNamePublicityPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXiApiKey; - } - - /// - /// 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.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs deleted file mode 100644 index c38c4684..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelPublicityModelsModelNamePublicityPostXiApiKey - { - - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs deleted file mode 100644 index 84739882..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetVersion - { - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion), - jsonSerializerContext) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion; - } - - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion? 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.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion; - } - - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs deleted file mode 100644 index 0629f9a5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetVersion - { - - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.Json.g.cs deleted file mode 100644 index 37369ef8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey - { - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey; - } - - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey? 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey; - } - - /// - /// 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs deleted file mode 100644 index 0054485a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey - { - - /// - /// 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.ModelVersionOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.Json.g.cs index e4da2e2a..9d7ccdd3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelVersionOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelVersionOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelVersionOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs index 23864c23..36cf5437 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ModelVersionOut { @@ -66,5 +66,6 @@ public ModelVersionOut( public ModelVersionOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.Json.g.cs deleted file mode 100644 index fa520ecd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelVersionsModelsModelNameVersionsGetXiApiKey - { - /// - /// 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.ModelVersionsModelsModelNameVersionsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXiApiKey; - } - - /// - /// 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.ModelVersionsModelsModelNameVersionsGetXiApiKey? 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.ModelVersionsModelsModelNameVersionsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXiApiKey; - } - - /// - /// 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.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs deleted file mode 100644 index d9ff29eb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelVersionsModelsModelNameVersionsGetXiApiKey - { - - /// - /// 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.ModelsDeploymentListModelsDeploymentListGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.Json.g.cs deleted file mode 100644 index 1a36a8b5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelsDeploymentListModelsDeploymentListGetXiApiKey - { - /// - /// 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.ModelsDeploymentListModelsDeploymentListGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXiApiKey; - } - - /// - /// 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.ModelsDeploymentListModelsDeploymentListGetXiApiKey? 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.ModelsDeploymentListModelsDeploymentListGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXiApiKey; - } - - /// - /// 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.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs deleted file mode 100644 index 11309c1b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelsDeploymentListModelsDeploymentListGetXiApiKey - { - - /// - /// 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.ModelsInfoModelsModelNameGetVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.Json.g.cs deleted file mode 100644 index a72f4132..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelsInfoModelsModelNameGetVersion - { - /// - /// 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.ModelsInfoModelsModelNameGetVersion? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelsInfoModelsModelNameGetVersion), - jsonSerializerContext) as global::DeepInfra.ModelsInfoModelsModelNameGetVersion; - } - - /// - /// 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.ModelsInfoModelsModelNameGetVersion? 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.ModelsInfoModelsModelNameGetVersion), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsInfoModelsModelNameGetVersion; - } - - /// - /// 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.ModelsInfoModelsModelNameGetVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs deleted file mode 100644 index 1fc7a314..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelsInfoModelsModelNameGetVersion - { - - /// - /// 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.ModelsInfoModelsModelNameGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.Json.g.cs deleted file mode 100644 index 6657da12..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelsInfoModelsModelNameGetXiApiKey - { - /// - /// 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.ModelsInfoModelsModelNameGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelsInfoModelsModelNameGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ModelsInfoModelsModelNameGetXiApiKey; - } - - /// - /// 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.ModelsInfoModelsModelNameGetXiApiKey? 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.ModelsInfoModelsModelNameGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsInfoModelsModelNameGetXiApiKey; - } - - /// - /// 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.ModelsInfoModelsModelNameGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs deleted file mode 100644 index 9fa3fbcf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelsInfoModelsModelNameGetXiApiKey - { - - /// - /// 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.OktaLoginOktaLoginGetLoginId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.Json.g.cs deleted file mode 100644 index a047a458..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OktaLoginOktaLoginGetLoginId - { - /// - /// 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.OktaLoginOktaLoginGetLoginId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OktaLoginOktaLoginGetLoginId), - jsonSerializerContext) as global::DeepInfra.OktaLoginOktaLoginGetLoginId; - } - - /// - /// 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.OktaLoginOktaLoginGetLoginId? 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.OktaLoginOktaLoginGetLoginId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OktaLoginOktaLoginGetLoginId; - } - - /// - /// 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.OktaLoginOktaLoginGetLoginId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs deleted file mode 100644 index dd1ea94d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OktaLoginOktaLoginGetLoginId - { - - /// - /// 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.OktaLoginOktaLoginGetOrigin.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.Json.g.cs deleted file mode 100644 index 9780753f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OktaLoginOktaLoginGetOrigin - { - /// - /// 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.OktaLoginOktaLoginGetOrigin? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OktaLoginOktaLoginGetOrigin), - jsonSerializerContext) as global::DeepInfra.OktaLoginOktaLoginGetOrigin; - } - - /// - /// 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.OktaLoginOktaLoginGetOrigin? 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.OktaLoginOktaLoginGetOrigin), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OktaLoginOktaLoginGetOrigin; - } - - /// - /// 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.OktaLoginOktaLoginGetOrigin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs deleted file mode 100644 index 14786d7e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OktaLoginOktaLoginGetOrigin - { - - /// - /// 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.OktaLoginOktaLoginGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.Json.g.cs index 455eb271..bac37a54 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OktaLoginOktaLoginGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OktaLoginOktaLoginGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OktaLoginOktaLoginGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs index e9cd9553..e75a7ddb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OktaLoginOktaLoginGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.Json.g.cs deleted file mode 100644 index bf238dfe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatch - { - /// - /// 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.OpenAIBatch? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatch), - jsonSerializerContext) as global::DeepInfra.OpenAIBatch; - } - - /// - /// 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.OpenAIBatch? 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.OpenAIBatch), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatch; - } - - /// - /// 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.OpenAIBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.g.cs deleted file mode 100644 index f432c893..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.g.cs +++ /dev/null @@ -1,222 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatch - { - /// - /// - /// - [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("object")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Object { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("endpoint")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Endpoint { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("errors")] - public object? Errors { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("input_file_id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string InputFileId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("completion_window")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CompletionWindow { 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("output_file_id")] - public string? OutputFileId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("error_file_id")] - public string? ErrorFileId { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int CreatedAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("in_progress_at")] - public int? InProgressAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("completed_at")] - public int? CompletedAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("failed_at")] - public int? FailedAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("finalizing_at")] - public int? FinalizingAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int ExpiresAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("expired_at")] - public int? ExpiredAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cancelled_at")] - public int? CancelledAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("cancelling_at")] - public int? CancellingAt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("request_counts")] - public object? RequestCounts { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { 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 OpenAIBatch( - string id, - string @object, - string endpoint, - string inputFileId, - string completionWindow, - string status, - int createdAt, - int expiresAt, - object? errors, - string? outputFileId, - string? errorFileId, - int? inProgressAt, - int? completedAt, - int? failedAt, - int? finalizingAt, - int? expiredAt, - int? cancelledAt, - int? cancellingAt, - object? requestCounts, - object? metadata) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Object = @object ?? throw new global::System.ArgumentNullException(nameof(@object)); - this.Endpoint = endpoint ?? throw new global::System.ArgumentNullException(nameof(endpoint)); - this.Errors = errors; - this.InputFileId = inputFileId ?? throw new global::System.ArgumentNullException(nameof(inputFileId)); - this.CompletionWindow = completionWindow ?? throw new global::System.ArgumentNullException(nameof(completionWindow)); - this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); - this.OutputFileId = outputFileId; - this.ErrorFileId = errorFileId; - this.CreatedAt = createdAt; - this.InProgressAt = inProgressAt; - this.CompletedAt = completedAt; - this.FailedAt = failedAt; - this.FinalizingAt = finalizingAt; - this.ExpiresAt = expiresAt; - this.ExpiredAt = expiredAt; - this.CancelledAt = cancelledAt; - this.CancellingAt = cancellingAt; - this.RequestCounts = requestCounts; - this.Metadata = metadata; - } - - /// - /// Initializes a new instance of the class. - /// - public OpenAIBatch() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.Json.g.cs deleted file mode 100644 index b8a4389f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchCancelledAt - { - /// - /// 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.OpenAIBatchCancelledAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchCancelledAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchCancelledAt; - } - - /// - /// 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.OpenAIBatchCancelledAt? 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.OpenAIBatchCancelledAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchCancelledAt; - } - - /// - /// 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.OpenAIBatchCancelledAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.g.cs deleted file mode 100644 index 78526af1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancelledAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchCancelledAt - { - - /// - /// 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.OpenAIBatchCancellingAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.Json.g.cs deleted file mode 100644 index 7fa6e198..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchCancellingAt - { - /// - /// 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.OpenAIBatchCancellingAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchCancellingAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchCancellingAt; - } - - /// - /// 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.OpenAIBatchCancellingAt? 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.OpenAIBatchCancellingAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchCancellingAt; - } - - /// - /// 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.OpenAIBatchCancellingAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.g.cs deleted file mode 100644 index 705a9abb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCancellingAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchCancellingAt - { - - /// - /// 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.OpenAIBatchCompletedAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.Json.g.cs deleted file mode 100644 index 3d43d632..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchCompletedAt - { - /// - /// 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.OpenAIBatchCompletedAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchCompletedAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchCompletedAt; - } - - /// - /// 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.OpenAIBatchCompletedAt? 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.OpenAIBatchCompletedAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchCompletedAt; - } - - /// - /// 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.OpenAIBatchCompletedAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.g.cs deleted file mode 100644 index 78486f2a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchCompletedAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchCompletedAt - { - - /// - /// 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.OpenAIBatchErrorFileId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.Json.g.cs deleted file mode 100644 index ba1205a1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchErrorFileId - { - /// - /// 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.OpenAIBatchErrorFileId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchErrorFileId), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchErrorFileId; - } - - /// - /// 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.OpenAIBatchErrorFileId? 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.OpenAIBatchErrorFileId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchErrorFileId; - } - - /// - /// 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.OpenAIBatchErrorFileId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.g.cs deleted file mode 100644 index d7b1c74a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrorFileId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchErrorFileId - { - - /// - /// 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.OpenAIBatchErrors.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.Json.g.cs deleted file mode 100644 index 55fe9478..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchErrors - { - /// - /// 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.OpenAIBatchErrors? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchErrors), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchErrors; - } - - /// - /// 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.OpenAIBatchErrors? 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.OpenAIBatchErrors), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchErrors; - } - - /// - /// 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.OpenAIBatchErrors.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.g.cs deleted file mode 100644 index 96a59014..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchErrors - { - - /// - /// 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.OpenAIBatchErrors2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.Json.g.cs deleted file mode 100644 index 316a7d08..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchErrors2 - { - /// - /// 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.OpenAIBatchErrors2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchErrors2), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchErrors2; - } - - /// - /// 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.OpenAIBatchErrors2? 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.OpenAIBatchErrors2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchErrors2; - } - - /// - /// 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.OpenAIBatchErrors2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.g.cs deleted file mode 100644 index ba2fb4a0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchErrors2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchErrors2 - { - - /// - /// 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.OpenAIBatchExpiredAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.Json.g.cs deleted file mode 100644 index f99c64b6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchExpiredAt - { - /// - /// 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.OpenAIBatchExpiredAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchExpiredAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchExpiredAt; - } - - /// - /// 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.OpenAIBatchExpiredAt? 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.OpenAIBatchExpiredAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchExpiredAt; - } - - /// - /// 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.OpenAIBatchExpiredAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.g.cs deleted file mode 100644 index 2eb8f78c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchExpiredAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchExpiredAt - { - - /// - /// 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.OpenAIBatchFailedAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.Json.g.cs deleted file mode 100644 index 4e2b927e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchFailedAt - { - /// - /// 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.OpenAIBatchFailedAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchFailedAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchFailedAt; - } - - /// - /// 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.OpenAIBatchFailedAt? 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.OpenAIBatchFailedAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchFailedAt; - } - - /// - /// 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.OpenAIBatchFailedAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.g.cs deleted file mode 100644 index 6206661a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFailedAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchFailedAt - { - - /// - /// 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.OpenAIBatchFinalizingAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.Json.g.cs deleted file mode 100644 index 24e7cc8a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchFinalizingAt - { - /// - /// 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.OpenAIBatchFinalizingAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchFinalizingAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchFinalizingAt; - } - - /// - /// 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.OpenAIBatchFinalizingAt? 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.OpenAIBatchFinalizingAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchFinalizingAt; - } - - /// - /// 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.OpenAIBatchFinalizingAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.g.cs deleted file mode 100644 index 30175b88..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchFinalizingAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchFinalizingAt - { - - /// - /// 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.OpenAIBatchInProgressAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.Json.g.cs deleted file mode 100644 index 618e6aeb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchInProgressAt - { - /// - /// 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.OpenAIBatchInProgressAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchInProgressAt), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchInProgressAt; - } - - /// - /// 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.OpenAIBatchInProgressAt? 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.OpenAIBatchInProgressAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchInProgressAt; - } - - /// - /// 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.OpenAIBatchInProgressAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.g.cs deleted file mode 100644 index feeeb0ef..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchInProgressAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchInProgressAt - { - - /// - /// 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.OpenAIBatchMetadata.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.Json.g.cs deleted file mode 100644 index 6539afee..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchMetadata - { - /// - /// 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.OpenAIBatchMetadata? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchMetadata), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchMetadata; - } - - /// - /// 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.OpenAIBatchMetadata? 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.OpenAIBatchMetadata), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchMetadata; - } - - /// - /// 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.OpenAIBatchMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.g.cs deleted file mode 100644 index c24331c9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchMetadata - { - - /// - /// 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.OpenAIBatchMetadata2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.Json.g.cs deleted file mode 100644 index ab345adb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchMetadata2 - { - /// - /// 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.OpenAIBatchMetadata2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchMetadata2), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchMetadata2; - } - - /// - /// 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.OpenAIBatchMetadata2? 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.OpenAIBatchMetadata2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchMetadata2; - } - - /// - /// 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.OpenAIBatchMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.g.cs deleted file mode 100644 index a163f68d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchMetadata2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchMetadata2 - { - - /// - /// 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.OpenAIBatchOutputFileId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.Json.g.cs deleted file mode 100644 index 05b298eb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchOutputFileId - { - /// - /// 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.OpenAIBatchOutputFileId? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchOutputFileId), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchOutputFileId; - } - - /// - /// 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.OpenAIBatchOutputFileId? 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.OpenAIBatchOutputFileId), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchOutputFileId; - } - - /// - /// 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.OpenAIBatchOutputFileId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.g.cs deleted file mode 100644 index dd16d748..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchOutputFileId.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchOutputFileId - { - - /// - /// 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.OpenAIBatchRequestCounts.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.Json.g.cs deleted file mode 100644 index 2a98e9a3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchRequestCounts - { - /// - /// 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.OpenAIBatchRequestCounts? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchRequestCounts), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchRequestCounts; - } - - /// - /// 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.OpenAIBatchRequestCounts? 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.OpenAIBatchRequestCounts), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchRequestCounts; - } - - /// - /// 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.OpenAIBatchRequestCounts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.g.cs deleted file mode 100644 index 684dc680..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchRequestCounts - { - - /// - /// 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.OpenAIBatchRequestCounts2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.Json.g.cs deleted file mode 100644 index 8f198de6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIBatchRequestCounts2 - { - /// - /// 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.OpenAIBatchRequestCounts2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIBatchRequestCounts2), - jsonSerializerContext) as global::DeepInfra.OpenAIBatchRequestCounts2; - } - - /// - /// 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.OpenAIBatchRequestCounts2? 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.OpenAIBatchRequestCounts2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchRequestCounts2; - } - - /// - /// 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.OpenAIBatchRequestCounts2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.g.cs deleted file mode 100644 index 9a852a49..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchRequestCounts2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenAIBatchRequestCounts2 - { - - /// - /// 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.OpenAIBatchesIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.Json.g.cs index e9e2d55f..6675486f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIBatchesIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs index a69a3b1d..764e737f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIBatchesIn { @@ -16,7 +16,7 @@ public sealed partial class OpenAIBatchesIn public required string InputFileId { get; set; } /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. + /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions, /v1/embeddings are supported. /// [global::System.Text.Json.Serialization.JsonPropertyName("endpoint")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.OpenAIBatchesInEndpointJsonConverter))] @@ -34,7 +34,13 @@ public sealed partial class OpenAIBatchesIn /// Optional metadata to be stored with the batch. /// [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] - public object? Metadata { get; set; } + public global::System.Collections.Generic.Dictionary? Metadata { get; set; } + + /// + /// The expiration policy for the output and/or error file generated for the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_expires_after")] + public global::DeepInfra.BatchOutputExpiresAfter? OutputExpiresAfter { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -49,11 +55,14 @@ public sealed partial class OpenAIBatchesIn /// 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 endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions, /v1/embeddings are supported. /// /// /// Optional metadata to be stored with the batch. /// + /// + /// The expiration policy for the output and/or error file generated for the batch. + /// /// /// The time frame within which the batch should be processed. Currently only 24h is supported. /// @@ -63,13 +72,15 @@ public sealed partial class OpenAIBatchesIn public OpenAIBatchesIn( string inputFileId, global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - object? metadata, + global::System.Collections.Generic.Dictionary? metadata, + global::DeepInfra.BatchOutputExpiresAfter? outputExpiresAfter, string completionWindow = "24h") { this.InputFileId = inputFileId ?? throw new global::System.ArgumentNullException(nameof(inputFileId)); this.Endpoint = endpoint; this.CompletionWindow = completionWindow; this.Metadata = metadata; + this.OutputExpiresAfter = outputExpiresAfter; } /// @@ -78,5 +89,6 @@ public OpenAIBatchesIn( public OpenAIBatchesIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInEndpoint.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInEndpoint.g.cs index 9986373c..459a9bdd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInEndpoint.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInEndpoint.g.cs @@ -4,18 +4,22 @@ namespace DeepInfra { /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. + /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions, /v1/embeddings are supported. /// public enum OpenAIBatchesInEndpoint { /// - /// + /// /// V1ChatCompletions, /// - /// + /// /// V1Completions, + /// + /// + /// + V1Embeddings, } /// @@ -32,6 +36,7 @@ public static string ToValueString(this OpenAIBatchesInEndpoint value) { OpenAIBatchesInEndpoint.V1ChatCompletions => "/v1/chat/completions", OpenAIBatchesInEndpoint.V1Completions => "/v1/completions", + OpenAIBatchesInEndpoint.V1Embeddings => "/v1/embeddings", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -44,6 +49,7 @@ public static string ToValueString(this OpenAIBatchesInEndpoint value) { "/v1/chat/completions" => OpenAIBatchesInEndpoint.V1ChatCompletions, "/v1/completions" => OpenAIBatchesInEndpoint.V1Completions, + "/v1/embeddings" => OpenAIBatchesInEndpoint.V1Embeddings, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.Json.g.cs index e81e0085..d2f48c67 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIBatchesInMetadata; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesInMetadata? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesInMetadata; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.Json.g.cs index c0bd2c03..a75c4fc3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIBatchesInMetadata2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesInMetadata2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesInMetadata2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs index 849dee33..e9d66c5f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIBatchesInMetadata2 { @@ -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.OpenAIBatchesInOutputExpiresAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInOutputExpiresAfter.Json.g.cs new file mode 100644 index 00000000..1d300bca --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInOutputExpiresAfter.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesInOutputExpiresAfter + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesInOutputExpiresAfter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesInOutputExpiresAfter), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesInOutputExpiresAfter; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesInOutputExpiresAfter? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesInOutputExpiresAfter? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesInOutputExpiresAfter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesInOutputExpiresAfter; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInOutputExpiresAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInOutputExpiresAfter.g.cs new file mode 100644 index 00000000..03a2c956 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInOutputExpiresAfter.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The expiration policy for the output and/or error file generated for the batch. + /// + public sealed partial class OpenAIBatchesInOutputExpiresAfter + { + + /// + /// 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.OpenAIBatchesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOut.Json.g.cs new file mode 100644 index 00000000..424af592 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOut), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOut.g.cs new file mode 100644 index 00000000..6e720f29 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOut.g.cs @@ -0,0 +1,288 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenAIBatchesOut + { + /// + /// The batch ID. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// The object type, which is always batch.
+ /// Default Value: batch + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string? Object { get; set; } + + /// + /// The API endpoint used for the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endpoint")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Endpoint { get; set; } + + /// + /// Errors that occurred during the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("errors")] + public global::DeepInfra.BatchErrors? Errors { get; set; } + + /// + /// The ID of the input file for the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_file_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string InputFileId { get; set; } + + /// + /// The time frame within which the batch should be processed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("completion_window")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CompletionWindow { get; set; } + + /// + /// The current status of the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Status { get; set; } + + /// + /// The ID of the output file. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output_file_id")] + public string? OutputFileId { get; set; } + + /// + /// The ID of the error file. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error_file_id")] + public string? ErrorFileId { get; set; } + + /// + /// The Unix timestamp of when the batch was created. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.UnixTimestampJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTimeOffset CreatedAt { get; set; } + + /// + /// The Unix timestamp of when the batch started processing. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("in_progress_at")] + public int? InProgressAt { get; set; } + + /// + /// The Unix timestamp of when the batch will expire. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.UnixTimestampJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTimeOffset ExpiresAt { get; set; } + + /// + /// The Unix timestamp of when the batch started finalizing. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("finalizing_at")] + public int? FinalizingAt { get; set; } + + /// + /// The Unix timestamp of when the batch completed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("completed_at")] + public int? CompletedAt { get; set; } + + /// + /// The Unix timestamp of when the batch failed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("failed_at")] + public int? FailedAt { get; set; } + + /// + /// The Unix timestamp of when the batch expired. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expired_at")] + public int? ExpiredAt { get; set; } + + /// + /// The Unix timestamp of when the batch started cancelling. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cancelling_at")] + public int? CancellingAt { get; set; } + + /// + /// The Unix timestamp of when the batch was cancelled. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cancelled_at")] + public int? CancelledAt { get; set; } + + /// + /// Request counts for the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("request_counts")] + public global::DeepInfra.BatchRequestCounts? RequestCounts { get; set; } + + /// + /// Metadata associated with the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] + public global::System.Collections.Generic.Dictionary? Metadata { get; set; } + + /// + /// The model used for the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// Token usage accumulated for the batch. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("usage")] + public global::DeepInfra.BatchUsage? Usage { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The batch ID. + /// + /// + /// The API endpoint used for the batch. + /// + /// + /// The ID of the input file for the batch. + /// + /// + /// The time frame within which the batch should be processed. + /// + /// + /// The current status of the batch. + /// + /// + /// The Unix timestamp of when the batch was created. + /// + /// + /// The Unix timestamp of when the batch will expire. + /// + /// + /// The object type, which is always batch.
+ /// Default Value: batch + /// + /// + /// Errors that occurred during the batch. + /// + /// + /// The ID of the output file. + /// + /// + /// The ID of the error file. + /// + /// + /// The Unix timestamp of when the batch started processing. + /// + /// + /// The Unix timestamp of when the batch started finalizing. + /// + /// + /// The Unix timestamp of when the batch completed. + /// + /// + /// The Unix timestamp of when the batch failed. + /// + /// + /// The Unix timestamp of when the batch expired. + /// + /// + /// The Unix timestamp of when the batch started cancelling. + /// + /// + /// The Unix timestamp of when the batch was cancelled. + /// + /// + /// Request counts for the batch. + /// + /// + /// Metadata associated with the batch. + /// + /// + /// The model used for the batch. + /// + /// + /// Token usage accumulated for the batch. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenAIBatchesOut( + string id, + string endpoint, + string inputFileId, + string completionWindow, + string status, + global::System.DateTimeOffset createdAt, + global::System.DateTimeOffset expiresAt, + string? @object, + global::DeepInfra.BatchErrors? errors, + string? outputFileId, + string? errorFileId, + int? inProgressAt, + int? finalizingAt, + int? completedAt, + int? failedAt, + int? expiredAt, + int? cancellingAt, + int? cancelledAt, + global::DeepInfra.BatchRequestCounts? requestCounts, + global::System.Collections.Generic.Dictionary? metadata, + string? model, + global::DeepInfra.BatchUsage? usage) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Object = @object; + this.Endpoint = endpoint ?? throw new global::System.ArgumentNullException(nameof(endpoint)); + this.Errors = errors; + this.InputFileId = inputFileId ?? throw new global::System.ArgumentNullException(nameof(inputFileId)); + this.CompletionWindow = completionWindow ?? throw new global::System.ArgumentNullException(nameof(completionWindow)); + this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); + this.OutputFileId = outputFileId; + this.ErrorFileId = errorFileId; + this.CreatedAt = createdAt; + this.InProgressAt = inProgressAt; + this.ExpiresAt = expiresAt; + this.FinalizingAt = finalizingAt; + this.CompletedAt = completedAt; + this.FailedAt = failedAt; + this.ExpiredAt = expiredAt; + this.CancellingAt = cancellingAt; + this.CancelledAt = cancelledAt; + this.RequestCounts = requestCounts; + this.Metadata = metadata; + this.Model = model; + this.Usage = usage; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenAIBatchesOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrors.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrors.Json.g.cs new file mode 100644 index 00000000..7c86a0d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrors.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutErrors + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutErrors? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutErrors), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutErrors; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutErrors? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesOutErrors? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesOutErrors), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutErrors; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrors.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrors.g.cs new file mode 100644 index 00000000..dfb19cee --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrors.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Errors that occurred during the batch. + /// + public sealed partial class OpenAIBatchesOutErrors + { + + /// + /// 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.OpenAIBatchesOutMetadata.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata.Json.g.cs new file mode 100644 index 00000000..4dd9f303 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutMetadata + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutMetadata? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutMetadata), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutMetadata; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutMetadata? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesOutMetadata? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesOutMetadata), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutMetadata; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata.g.cs new file mode 100644 index 00000000..723d58fd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Metadata associated with the batch. + /// + public sealed partial class OpenAIBatchesOutMetadata + { + + /// + /// 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.OpenAIBatchesOutMetadata2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata2.Json.g.cs new file mode 100644 index 00000000..b95ec08b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutMetadata2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutMetadata2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutMetadata2), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutMetadata2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutMetadata2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesOutMetadata2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesOutMetadata2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutMetadata2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata2.g.cs new file mode 100644 index 00000000..34eab950 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutMetadata2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenAIBatchesOutMetadata2 + { + + /// + /// 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.OpenAIBatchesOutRequestCounts.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutRequestCounts.Json.g.cs new file mode 100644 index 00000000..3a209569 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutRequestCounts.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutRequestCounts + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutRequestCounts? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutRequestCounts), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutRequestCounts; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutRequestCounts? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesOutRequestCounts? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesOutRequestCounts), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutRequestCounts; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutRequestCounts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutRequestCounts.g.cs new file mode 100644 index 00000000..48443b4d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutRequestCounts.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Request counts for the batch. + /// + public sealed partial class OpenAIBatchesOutRequestCounts + { + + /// + /// 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.OpenAIBatchesOutUsage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutUsage.Json.g.cs new file mode 100644 index 00000000..030aabc0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutUsage.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutUsage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutUsage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutUsage), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutUsage; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutUsage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIBatchesOutUsage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIBatchesOutUsage), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutUsage; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutUsage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutUsage.g.cs new file mode 100644 index 00000000..79b7df74 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutUsage.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Token usage accumulated for the batch. + /// + public sealed partial class OpenAIBatchesOutUsage + { + + /// + /// 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.OpenAIChatCompletionsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.Json.g.cs index 299d7d2e..d53ff5f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs index e3e6c3d0..1a6f677a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs @@ -4,10 +4,29 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIChatCompletionsIn { + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("fail_fast")] + public bool? FailFast { get; set; } + + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("models")] + public global::System.Collections.Generic.IList? Models { get; set; } + /// /// model name /// @@ -20,7 +39,7 @@ public sealed partial class OpenAIChatCompletionsIn ///
[global::System.Text.Json.Serialization.JsonPropertyName("messages")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList> Messages { get; set; } + public required global::System.Collections.Generic.IList> Messages { get; set; } /// /// whether to stream the output via SSE or return the full response
@@ -59,7 +78,7 @@ public sealed partial class OpenAIChatCompletionsIn /// /// 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. + /// 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 65536, whichever is smaller. ///
[global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] public int? MaxTokens { get; set; } @@ -71,6 +90,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 @@ -96,14 +121,14 @@ public sealed partial class OpenAIChatCompletionsIn /// A list of tools the model may call. Currently, only functions are supported as a tool. ///
[global::System.Text.Json.Serialization.JsonPropertyName("tools")] - public global::System.Collections.Generic.IList? Tools { get; set; } + public global::System.Collections.Generic.IList? Tools { get; set; } /// /// 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. /// [global::System.Text.Json.Serialization.JsonPropertyName("tool_choice")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] - public global::DeepInfra.AnyOf? ToolChoice { get; set; } + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + public global::DeepInfra.AnyOf? ToolChoice { get; set; } /// /// The format of the response. Currently, only json is supported. @@ -144,7 +169,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, minimal, low, medium, high, xhigh, and max. 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; } @@ -161,12 +186,30 @@ public sealed partial class OpenAIChatCompletionsIn [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")] public string? PromptCacheKey { get; set; } + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_options")] + public global::DeepInfra.PromptCacheOptions? PromptCacheOptions { get; set; } + /// /// Chat template kwargs. /// [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; } + + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ignore_eos")] + public bool? IgnoreEos { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -182,6 +225,16 @@ public sealed partial class OpenAIChatCompletionsIn /// /// conversation messages: (user,assistant,tool)*,user including one system message anywhere /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// /// /// whether to stream the output via SSE or return the full response
/// Default Value: false @@ -204,11 +257,14 @@ public sealed partial class OpenAIChatCompletionsIn /// /// /// 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. + /// 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 65536, 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 @@ -247,7 +303,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, minimal, low, medium, high, xhigh, and max. 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. @@ -255,15 +311,27 @@ public sealed partial class OpenAIChatCompletionsIn /// /// 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. /// + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// /// /// 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. + /// + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public OpenAIChatCompletionsIn( string model, - global::System.Collections.Generic.IList> messages, + global::System.Collections.Generic.IList> messages, + global::DeepInfra.ServiceTier? serviceTier, + bool? failFast, + global::System.Collections.Generic.IList? models, bool? stream, double? temperature, double? topP, @@ -271,11 +339,12 @@ public OpenAIChatCompletionsIn( int? topK, int? maxTokens, global::DeepInfra.AnyOf, object>? stop, + global::System.Collections.Generic.IList? stopTokenIds, int? n, double? presencePenalty, double? frequencyPenalty, - global::System.Collections.Generic.IList? tools, - global::DeepInfra.AnyOf? toolChoice, + global::System.Collections.Generic.IList? tools, + global::DeepInfra.AnyOf? toolChoice, global::DeepInfra.AnyOf? responseFormat, double? repetitionPenalty, string? user, @@ -285,8 +354,14 @@ public OpenAIChatCompletionsIn( global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort, global::DeepInfra.ChatReasoningSettings? reasoning, string? promptCacheKey, - object? chatTemplateKwargs) + global::DeepInfra.PromptCacheOptions? promptCacheOptions, + object? chatTemplateKwargs, + bool? continueFinalMessage, + bool? ignoreEos) { + this.ServiceTier = serviceTier; + this.FailFast = failFast; + this.Models = models; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); this.Stream = stream; @@ -296,6 +371,7 @@ public OpenAIChatCompletionsIn( this.TopK = topK; this.MaxTokens = maxTokens; this.Stop = stop; + this.StopTokenIds = stopTokenIds; this.N = n; this.PresencePenalty = presencePenalty; this.FrequencyPenalty = frequencyPenalty; @@ -310,7 +386,10 @@ public OpenAIChatCompletionsIn( this.ReasoningEffort = reasoningEffort; this.Reasoning = reasoning; this.PromptCacheKey = promptCacheKey; + this.PromptCacheOptions = promptCacheOptions; this.ChatTemplateKwargs = chatTemplateKwargs; + this.ContinueFinalMessage = continueFinalMessage; + this.IgnoreEos = ignoreEos; } /// @@ -319,5 +398,6 @@ public OpenAIChatCompletionsIn( public OpenAIChatCompletionsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.Json.g.cs index e53a3797..8a94d655 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInChatTemplateKwargs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInChatTemplateKwargs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInChatTemplateKwargs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.Json.g.cs index 1dc82cdb..a68e37a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInChatTemplateKwargs2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInChatTemplateKwargs2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInChatTemplateKwargs2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs index ec172e52..fb1217c4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIChatCompletionsInChatTemplateKwargs2 { @@ -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.OpenAIChatCompletionsInLogprobs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.Json.g.cs deleted file mode 100644 index eb8ff796..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInLogprobs - { - /// - /// 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.OpenAIChatCompletionsInLogprobs? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInLogprobs), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInLogprobs; - } - - /// - /// 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.OpenAIChatCompletionsInLogprobs? 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.OpenAIChatCompletionsInLogprobs), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInLogprobs; - } - - /// - /// 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.OpenAIChatCompletionsInLogprobs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs deleted file mode 100644 index 2f58cf26..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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`. - /// - public sealed partial class OpenAIChatCompletionsInLogprobs - { - - /// - /// 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.OpenAIChatCompletionsInMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.Json.g.cs deleted file mode 100644 index 12a9fb7a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInMaxTokens - { - /// - /// 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.OpenAIChatCompletionsInMaxTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInMaxTokens), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInMaxTokens; - } - - /// - /// 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.OpenAIChatCompletionsInMaxTokens? 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.OpenAIChatCompletionsInMaxTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInMaxTokens; - } - - /// - /// 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.OpenAIChatCompletionsInMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs deleted file mode 100644 index 5dab1141..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - ///
- public sealed partial class OpenAIChatCompletionsInMaxTokens - { - - /// - /// 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.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs deleted file mode 100644 index f01e015e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInPromptCacheKey - { - /// - /// 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.OpenAIChatCompletionsInPromptCacheKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInPromptCacheKey), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInPromptCacheKey; - } - - /// - /// 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.OpenAIChatCompletionsInPromptCacheKey? 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.OpenAIChatCompletionsInPromptCacheKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInPromptCacheKey; - } - - /// - /// 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.OpenAIChatCompletionsInPromptCacheKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs deleted file mode 100644 index 55925ad0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - /// - public sealed partial class OpenAIChatCompletionsInPromptCacheKey - { - - /// - /// 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.OpenAIChatCompletionsInPromptCacheOptions.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheOptions.Json.g.cs new file mode 100644 index 00000000..a4d7c88a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIChatCompletionsInPromptCacheOptions + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions), + jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInPromptCacheOptions; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheOptions.g.cs new file mode 100644 index 00000000..0fec1c3c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheOptions.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + public sealed partial class OpenAIChatCompletionsInPromptCacheOptions + { + + /// + /// 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.OpenAIChatCompletionsInReasoning.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.Json.g.cs index 17865012..b9fe0e68 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInReasoning; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInReasoning? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInReasoning; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.Json.g.cs deleted file mode 100644 index 2a653f1e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInReasoningEffort - { - /// - /// 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.OpenAIChatCompletionsInReasoningEffort? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInReasoningEffort), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInReasoningEffort; - } - - /// - /// 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.OpenAIChatCompletionsInReasoningEffort? 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.OpenAIChatCompletionsInReasoningEffort), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInReasoningEffort; - } - - /// - /// 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.OpenAIChatCompletionsInReasoningEffort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs index 441725cd..1b208256 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, minimal, low, medium, high, xhigh, and max. 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..c0a67bb6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs @@ -4,26 +4,38 @@ namespace DeepInfra { /// - /// + /// /// public enum OpenAIChatCompletionsInReasoningEffort2 { /// - /// + /// /// High, /// - /// + /// /// Low, /// - /// + /// + /// + Max, + /// + /// /// Medium, /// - /// + /// + /// + Minimal, + /// + /// /// None, + /// + /// + /// + Xhigh, } /// @@ -40,8 +52,11 @@ public static string ToValueString(this OpenAIChatCompletionsInReasoningEffort2 { OpenAIChatCompletionsInReasoningEffort2.High => "high", OpenAIChatCompletionsInReasoningEffort2.Low => "low", + OpenAIChatCompletionsInReasoningEffort2.Max => "max", OpenAIChatCompletionsInReasoningEffort2.Medium => "medium", + OpenAIChatCompletionsInReasoningEffort2.Minimal => "minimal", OpenAIChatCompletionsInReasoningEffort2.None => "none", + OpenAIChatCompletionsInReasoningEffort2.Xhigh => "xhigh", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -54,8 +69,11 @@ public static string ToValueString(this OpenAIChatCompletionsInReasoningEffort2 { "high" => OpenAIChatCompletionsInReasoningEffort2.High, "low" => OpenAIChatCompletionsInReasoningEffort2.Low, + "max" => OpenAIChatCompletionsInReasoningEffort2.Max, "medium" => OpenAIChatCompletionsInReasoningEffort2.Medium, + "minimal" => OpenAIChatCompletionsInReasoningEffort2.Minimal, "none" => OpenAIChatCompletionsInReasoningEffort2.None, + "xhigh" => OpenAIChatCompletionsInReasoningEffort2.Xhigh, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs deleted file mode 100644 index dc82db2b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInSeed - { - /// - /// 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.OpenAIChatCompletionsInSeed? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInSeed), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInSeed; - } - - /// - /// 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.OpenAIChatCompletionsInSeed? 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.OpenAIChatCompletionsInSeed), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInSeed; - } - - /// - /// 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.OpenAIChatCompletionsInSeed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs deleted file mode 100644 index 0075abde..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - public sealed partial class OpenAIChatCompletionsInSeed - { - - /// - /// 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.OpenAIChatCompletionsInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInServiceTier.g.cs new file mode 100644 index 00000000..e062ced4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInServiceTier.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + public sealed partial class OpenAIChatCompletionsInServiceTier + { + + /// + /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.Json.g.cs index e762fb6a..358bf124 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInStreamOptions; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInStreamOptions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInStreamOptions; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.OpenAIChatCompletionsInToolChoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInToolChoice.g.cs new file mode 100644 index 00000000..caae593f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInToolChoice.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum OpenAIChatCompletionsInToolChoice + { + /// + /// + /// + Auto, + /// + /// + /// + None, + /// + /// + /// + Required, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class OpenAIChatCompletionsInToolChoiceExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this OpenAIChatCompletionsInToolChoice value) + { + return value switch + { + OpenAIChatCompletionsInToolChoice.Auto => "auto", + OpenAIChatCompletionsInToolChoice.None => "none", + OpenAIChatCompletionsInToolChoice.Required => "required", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static OpenAIChatCompletionsInToolChoice? ToEnum(string value) + { + return value switch + { + "auto" => OpenAIChatCompletionsInToolChoice.Auto, + "none" => OpenAIChatCompletionsInToolChoice.None, + "required" => OpenAIChatCompletionsInToolChoice.Required, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.Json.g.cs deleted file mode 100644 index 06a91504..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInTools - { - /// - /// 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.OpenAIChatCompletionsInTools? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInTools), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInTools; - } - - /// - /// 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.OpenAIChatCompletionsInTools? 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.OpenAIChatCompletionsInTools), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInTools; - } - - /// - /// 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.OpenAIChatCompletionsInTools.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs deleted file mode 100644 index 878ca8ac..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - public sealed partial class OpenAIChatCompletionsInTools - { - - /// - /// 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.OpenAIChatCompletionsInUser.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.Json.g.cs deleted file mode 100644 index 0413e07c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIChatCompletionsInUser - { - /// - /// 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.OpenAIChatCompletionsInUser? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIChatCompletionsInUser), - jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInUser; - } - - /// - /// 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.OpenAIChatCompletionsInUser? 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.OpenAIChatCompletionsInUser), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInUser; - } - - /// - /// 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.OpenAIChatCompletionsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs deleted file mode 100644 index ac5509fa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - /// - public sealed partial class OpenAIChatCompletionsInUser - { - - /// - /// 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.OpenAICompletionsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.Json.g.cs index 74a72bd8..61fc3a66 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs index 7625126b..cb9b9cf6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs @@ -4,10 +4,29 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAICompletionsIn { + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("fail_fast")] + public bool? FailFast { get; set; } + + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("models")] + public global::System.Collections.Generic.IList? Models { get; set; } + /// /// model name /// @@ -25,7 +44,7 @@ public sealed partial class OpenAICompletionsIn /// /// 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. + /// 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 65536, whichever is smaller. ///
[global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] public int? MaxTokens { get; set; } @@ -138,7 +157,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; } @@ -155,12 +174,24 @@ public sealed partial class OpenAICompletionsIn [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")] public string? PromptCacheKey { get; set; } + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_options")] + public global::DeepInfra.PromptCacheOptions? PromptCacheOptions { get; set; } + /// /// 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,...'). /// [global::System.Text.Json.Serialization.JsonPropertyName("data")] public global::DeepInfra.CompletionMultiModalData? Data { get; set; } + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ignore_eos")] + public bool? IgnoreEos { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -176,9 +207,19 @@ public sealed partial class OpenAICompletionsIn /// /// input prompt - a single string is currently supported /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// /// /// 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. + /// 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 65536, 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
@@ -238,7 +279,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 @@ -246,15 +287,24 @@ public sealed partial class OpenAICompletionsIn /// /// 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. /// + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// /// /// 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,...'). /// + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public OpenAICompletionsIn( string model, global::DeepInfra.AnyOf> prompt, + global::DeepInfra.ServiceTier? serviceTier, + bool? failFast, + global::System.Collections.Generic.IList? models, int? maxTokens, double? temperature, double? topP, @@ -275,8 +325,13 @@ public OpenAICompletionsIn( global::System.Collections.Generic.IList? stopTokenIds, bool? returnTokensAsTokenIds, string? promptCacheKey, - global::DeepInfra.CompletionMultiModalData? data) + global::DeepInfra.PromptCacheOptions? promptCacheOptions, + global::DeepInfra.CompletionMultiModalData? data, + bool? ignoreEos) { + this.ServiceTier = serviceTier; + this.FailFast = failFast; + this.Models = models; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Prompt = prompt; this.MaxTokens = maxTokens; @@ -299,7 +354,9 @@ public OpenAICompletionsIn( this.StopTokenIds = stopTokenIds; this.ReturnTokensAsTokenIds = returnTokensAsTokenIds; this.PromptCacheKey = promptCacheKey; + this.PromptCacheOptions = promptCacheOptions; this.Data = data; + this.IgnoreEos = ignoreEos; } /// @@ -308,5 +365,6 @@ public OpenAICompletionsIn( public OpenAICompletionsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.Json.g.cs index 180f0c15..ae044218 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInData? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.Json.g.cs deleted file mode 100644 index 87afdfbc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInEcho - { - /// - /// 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.OpenAICompletionsInEcho? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInEcho), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInEcho; - } - - /// - /// 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.OpenAICompletionsInEcho? 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.OpenAICompletionsInEcho), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInEcho; - } - - /// - /// 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.OpenAICompletionsInEcho.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs deleted file mode 100644 index 7cf28c05..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// return prompt as part of the respons - /// - public sealed partial class OpenAICompletionsInEcho - { - - /// - /// 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.OpenAICompletionsInLogprobs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.Json.g.cs deleted file mode 100644 index 2be66795..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInLogprobs - { - /// - /// 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.OpenAICompletionsInLogprobs? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInLogprobs), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInLogprobs; - } - - /// - /// 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.OpenAICompletionsInLogprobs? 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.OpenAICompletionsInLogprobs), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInLogprobs; - } - - /// - /// 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.OpenAICompletionsInLogprobs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs deleted file mode 100644 index 5e7f5079..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// return top tokens and their log-probabilities - /// - public sealed partial class OpenAICompletionsInLogprobs - { - - /// - /// 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.OpenAICompletionsInMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.Json.g.cs deleted file mode 100644 index 06e18359..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInMaxTokens - { - /// - /// 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.OpenAICompletionsInMaxTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInMaxTokens), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInMaxTokens; - } - - /// - /// 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.OpenAICompletionsInMaxTokens? 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.OpenAICompletionsInMaxTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInMaxTokens; - } - - /// - /// 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.OpenAICompletionsInMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs deleted file mode 100644 index ba51ef8c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs +++ /dev/null @@ -1,19 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - ///
- public sealed partial class OpenAICompletionsInMaxTokens - { - - /// - /// 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.OpenAICompletionsInPromptCacheKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.Json.g.cs deleted file mode 100644 index a9a697c9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInPromptCacheKey - { - /// - /// 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.OpenAICompletionsInPromptCacheKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInPromptCacheKey), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInPromptCacheKey; - } - - /// - /// 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.OpenAICompletionsInPromptCacheKey? 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.OpenAICompletionsInPromptCacheKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInPromptCacheKey; - } - - /// - /// 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.OpenAICompletionsInPromptCacheKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs deleted file mode 100644 index a14d4a72..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - /// - public sealed partial class OpenAICompletionsInPromptCacheKey - { - - /// - /// 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.OpenAICompletionsInPromptCacheOptions.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheOptions.Json.g.cs new file mode 100644 index 00000000..8824fbbd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAICompletionsInPromptCacheOptions + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInPromptCacheOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAICompletionsInPromptCacheOptions), + jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInPromptCacheOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInPromptCacheOptions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAICompletionsInPromptCacheOptions? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAICompletionsInPromptCacheOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInPromptCacheOptions; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheOptions.g.cs new file mode 100644 index 00000000..69bf6e5c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheOptions.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + public sealed partial class OpenAICompletionsInPromptCacheOptions + { + + /// + /// 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.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs deleted file mode 100644 index 40e06105..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInReturnTokensAsTokenIds - { - /// - /// 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.OpenAICompletionsInReturnTokensAsTokenIds? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInReturnTokensAsTokenIds), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInReturnTokensAsTokenIds; - } - - /// - /// 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.OpenAICompletionsInReturnTokensAsTokenIds? 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.OpenAICompletionsInReturnTokensAsTokenIds), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInReturnTokensAsTokenIds; - } - - /// - /// 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.OpenAICompletionsInReturnTokensAsTokenIds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs deleted file mode 100644 index 058e6012..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// return tokens as token ids - /// - public sealed partial class OpenAICompletionsInReturnTokensAsTokenIds - { - - /// - /// 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.OpenAICompletionsInSeed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.Json.g.cs deleted file mode 100644 index 22b4f96a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInSeed - { - /// - /// 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.OpenAICompletionsInSeed? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInSeed), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInSeed; - } - - /// - /// 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.OpenAICompletionsInSeed? 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.OpenAICompletionsInSeed), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInSeed; - } - - /// - /// 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.OpenAICompletionsInSeed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs deleted file mode 100644 index 87b688e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - public sealed partial class OpenAICompletionsInSeed - { - - /// - /// 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.OpenAICompletionsInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInServiceTier.g.cs new file mode 100644 index 00000000..6c6aa80f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInServiceTier.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + public sealed partial class OpenAICompletionsInServiceTier + { + + /// + /// 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.OpenAICompletionsInStopTokenIds.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.Json.g.cs deleted file mode 100644 index 78e74eba..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInStopTokenIds - { - /// - /// 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.OpenAICompletionsInStopTokenIds? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInStopTokenIds), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInStopTokenIds; - } - - /// - /// 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.OpenAICompletionsInStopTokenIds? 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.OpenAICompletionsInStopTokenIds), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInStopTokenIds; - } - - /// - /// 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.OpenAICompletionsInStopTokenIds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs deleted file mode 100644 index 89c15069..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// List of token IDs that will stop generation when encountered - /// - public sealed partial class OpenAICompletionsInStopTokenIds - { - - /// - /// 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.OpenAICompletionsInStreamOptions.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.Json.g.cs index 6cf7621b..f8a5bb72 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInStreamOptions; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInStreamOptions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInStreamOptions; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.Json.g.cs deleted file mode 100644 index 6db47efc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAICompletionsInUser - { - /// - /// 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.OpenAICompletionsInUser? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAICompletionsInUser), - jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInUser; - } - - /// - /// 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.OpenAICompletionsInUser? 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.OpenAICompletionsInUser), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInUser; - } - - /// - /// 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.OpenAICompletionsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs deleted file mode 100644 index 90151fa9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - /// - public sealed partial class OpenAICompletionsInUser - { - - /// - /// 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.OpenAIEmbeddingsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.Json.g.cs index dd04938d..18bb4f68 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIEmbeddingsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs index a64899a5..4bad91c8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs @@ -4,16 +4,23 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIEmbeddingsIn { /// - /// 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). + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. /// [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("fail_fast")] + public bool? FailFast { get; set; } + /// /// model name /// @@ -22,12 +29,18 @@ public sealed partial class OpenAIEmbeddingsIn public required string Model { get; set; } /// - /// sequences to embed + /// text or multimodal content to embed. Each item is either a string, or a list of content parts ({"type":"text"} / {"type":"image_url"}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2. /// [global::System.Text.Json.Serialization.JsonPropertyName("input")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, string>))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>>))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf, string> Input { get; set; } + public required global::DeepInfra.AnyOf>>> Input { get; set; } + + /// + /// Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input_type")] + public global::DeepInfra.OpenAIEmbeddingsInInputType2? InputType { get; set; } /// /// format used when encoding
@@ -56,10 +69,17 @@ public sealed partial class OpenAIEmbeddingsIn /// model name /// /// - /// sequences to embed + /// text or multimodal content to embed. Each item is either a string, or a list of content parts ({"type":"text"} / {"type":"image_url"}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2. /// /// - /// 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). + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models. /// /// /// format used when encoding
@@ -73,14 +93,18 @@ public sealed partial class OpenAIEmbeddingsIn #endif public OpenAIEmbeddingsIn( string model, - global::DeepInfra.AnyOf, string> input, + global::DeepInfra.AnyOf>>> input, global::DeepInfra.ServiceTier? serviceTier, + bool? failFast, + global::DeepInfra.OpenAIEmbeddingsInInputType2? inputType, global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat, int? dimensions) { this.ServiceTier = serviceTier; + this.FailFast = failFast; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Input = input; + this.InputType = inputType; this.EncodingFormat = encodingFormat; this.Dimensions = dimensions; } @@ -91,5 +115,6 @@ public OpenAIEmbeddingsIn( public OpenAIEmbeddingsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.Json.g.cs deleted file mode 100644 index 51e44eb3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIEmbeddingsInDimensions - { - /// - /// 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.OpenAIEmbeddingsInDimensions? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIEmbeddingsInDimensions), - jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsInDimensions; - } - - /// - /// 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.OpenAIEmbeddingsInDimensions? 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.OpenAIEmbeddingsInDimensions), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsInDimensions; - } - - /// - /// 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.OpenAIEmbeddingsInDimensions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs deleted file mode 100644 index 0288ed29..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - /// - public sealed partial class OpenAIEmbeddingsInDimensions - { - - /// - /// 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.OpenAIEmbeddingsInEncodingFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInEncodingFormat.g.cs index 64322589..c7c2648e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInEncodingFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInEncodingFormat.g.cs @@ -10,11 +10,11 @@ namespace DeepInfra public enum OpenAIEmbeddingsInEncodingFormat { /// - /// + /// /// Base64, /// - /// + /// /// Float, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType.g.cs new file mode 100644 index 00000000..024aef97 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models. + /// + public sealed partial class OpenAIEmbeddingsInInputType + { + + /// + /// 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.OpenAIEmbeddingsInInputType2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType2.g.cs new file mode 100644 index 00000000..746cc088 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType2.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum OpenAIEmbeddingsInInputType2 + { + /// + /// + /// + Document, + /// + /// + /// + Passage, + /// + /// + /// + Query, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class OpenAIEmbeddingsInInputType2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this OpenAIEmbeddingsInInputType2 value) + { + return value switch + { + OpenAIEmbeddingsInInputType2.Document => "document", + OpenAIEmbeddingsInInputType2.Passage => "passage", + OpenAIEmbeddingsInInputType2.Query => "query", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static OpenAIEmbeddingsInInputType2? ToEnum(string value) + { + return value switch + { + "document" => OpenAIEmbeddingsInInputType2.Document, + "passage" => OpenAIEmbeddingsInInputType2.Passage, + "query" => OpenAIEmbeddingsInInputType2.Query, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator.Json.g.cs new file mode 100644 index 00000000..e53882d8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator), + jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator.g.cs new file mode 100644 index 00000000..0beb318a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeJsonConverter))] + public global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? Type { 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 OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator( + global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? type) + { + this.Type = type; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.g.cs new file mode 100644 index 00000000..374309f4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType + { + /// + /// + /// + ImageUrl, + /// + /// + /// + Text, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorTypeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType value) + { + return value switch + { + OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.ImageUrl => "image_url", + OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.Text => "text", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? ToEnum(string value) + { + return value switch + { + "image_url" => OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.ImageUrl, + "text" => OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType.Text, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.Json.g.cs deleted file mode 100644 index bf913347..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIEmbeddingsInServiceTier - { - /// - /// 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.OpenAIEmbeddingsInServiceTier? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIEmbeddingsInServiceTier), - jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsInServiceTier; - } - - /// - /// 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.OpenAIEmbeddingsInServiceTier? 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.OpenAIEmbeddingsInServiceTier), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsInServiceTier; - } - - /// - /// 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.OpenAIEmbeddingsInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs index 1a2ad41b..08622b60 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// 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). + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. /// public sealed partial class OpenAIEmbeddingsInServiceTier { @@ -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.OpenAIFile.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFile.Json.g.cs new file mode 100644 index 00000000..d2807756 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFile.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIFile + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIFile? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIFile), + jsonSerializerContext) as global::DeepInfra.OpenAIFile; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIFile? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenAIFile? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenAIFile), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIFile; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFile.g.cs new file mode 100644 index 00000000..8b92ca53 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFile.g.cs @@ -0,0 +1,105 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenAIFile + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + /// "file" + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string Object { get; set; } = "file"; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CreatedAt { 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("bytes")] + [global::System.Text.Json.Serialization.JsonRequired] + public required long Bytes { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("purpose")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.OpenAIFilePurposeJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.OpenAIFilePurpose Purpose { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("expires_at")] + public int? ExpiresAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenAIFile( + string id, + int createdAt, + string filename, + long bytes, + global::DeepInfra.OpenAIFilePurpose purpose, + int? expiresAt, + string @object = "file") + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Object = @object; + this.CreatedAt = createdAt; + this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); + this.Bytes = bytes; + this.Purpose = purpose; + this.ExpiresAt = expiresAt; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenAIFile() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFilePurpose.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFilePurpose.g.cs new file mode 100644 index 00000000..7f7a44bb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFilePurpose.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum OpenAIFilePurpose + { + /// + /// + /// + Batch, + /// + /// + /// + BatchOutput, + /// + /// + /// + FineTune, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class OpenAIFilePurposeExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this OpenAIFilePurpose value) + { + return value switch + { + OpenAIFilePurpose.Batch => "batch", + OpenAIFilePurpose.BatchOutput => "batch_output", + OpenAIFilePurpose.FineTune => "fine-tune", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static OpenAIFilePurpose? ToEnum(string value) + { + return value switch + { + "batch" => OpenAIFilePurpose.Batch, + "batch_output" => OpenAIFilePurpose.BatchOutput, + "fine-tune" => OpenAIFilePurpose.FineTune, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.Json.g.cs index 78a50752..e9aec25e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImageData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImageData? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs index 85143abb..e6ea6774 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIImageData { @@ -63,5 +63,6 @@ public OpenAIImageData( public OpenAIImageData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs deleted file mode 100644 index 2112011b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImageDataB64Json - { - /// - /// 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.OpenAIImageDataB64Json? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImageDataB64Json), - jsonSerializerContext) as global::DeepInfra.OpenAIImageDataB64Json; - } - - /// - /// 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.OpenAIImageDataB64Json? 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.OpenAIImageDataB64Json), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageDataB64Json; - } - - /// - /// 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.OpenAIImageDataB64Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs deleted file mode 100644 index 8ef9ee50..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The base64-encoded image data - /// - public sealed partial class OpenAIImageDataB64Json - { - - /// - /// 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.OpenAIImageDataRevisedPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.Json.g.cs deleted file mode 100644 index 33359d96..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImageDataRevisedPrompt - { - /// - /// 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.OpenAIImageDataRevisedPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImageDataRevisedPrompt), - jsonSerializerContext) as global::DeepInfra.OpenAIImageDataRevisedPrompt; - } - - /// - /// 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.OpenAIImageDataRevisedPrompt? 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.OpenAIImageDataRevisedPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageDataRevisedPrompt; - } - - /// - /// 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.OpenAIImageDataRevisedPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs deleted file mode 100644 index 8630b6ed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The prompt used to generate this image - /// - public sealed partial class OpenAIImageDataRevisedPrompt - { - - /// - /// 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.OpenAIImageDataUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.Json.g.cs deleted file mode 100644 index b1be6299..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImageDataUrl - { - /// - /// 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.OpenAIImageDataUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImageDataUrl), - jsonSerializerContext) as global::DeepInfra.OpenAIImageDataUrl; - } - - /// - /// 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.OpenAIImageDataUrl? 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.OpenAIImageDataUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageDataUrl; - } - - /// - /// 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.OpenAIImageDataUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs deleted file mode 100644 index 80178a45..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The URL of the generated image - /// - public sealed partial class OpenAIImageDataUrl - { - - /// - /// 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.OpenAIImagesEditsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.Json.g.cs index 059b2d91..8e6ad013 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesEditsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs index 949b18d2..2afcb622 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIImagesEditsIn { @@ -150,5 +150,6 @@ public OpenAIImagesEditsIn( public OpenAIImagesEditsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs deleted file mode 100644 index 2c18bb62..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesEditsInMask - { - /// - /// 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.OpenAIImagesEditsInMask? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesEditsInMask), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsInMask; - } - - /// - /// 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.OpenAIImagesEditsInMask? 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.OpenAIImagesEditsInMask), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsInMask; - } - - /// - /// 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.OpenAIImagesEditsInMask.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs deleted file mode 100644 index f6e960ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// 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. - /// - public sealed partial class OpenAIImagesEditsInMask - { - - /// - /// 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.OpenAIImagesEditsInResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.Json.g.cs deleted file mode 100644 index c2b04ba6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesEditsInResponseFormat - { - /// - /// 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.OpenAIImagesEditsInResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesEditsInResponseFormat), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsInResponseFormat; - } - - /// - /// 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.OpenAIImagesEditsInResponseFormat? 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.OpenAIImagesEditsInResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsInResponseFormat; - } - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.Json.g.cs deleted file mode 100644 index 4780576e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesEditsInUser - { - /// - /// 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.OpenAIImagesEditsInUser? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesEditsInUser), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsInUser; - } - - /// - /// 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.OpenAIImagesEditsInUser? 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.OpenAIImagesEditsInUser), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsInUser; - } - - /// - /// 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.OpenAIImagesEditsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs deleted file mode 100644 index 11e0fc82..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - public sealed partial class OpenAIImagesEditsInUser - { - - /// - /// 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.OpenAIImagesGenerationsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.Json.g.cs index 24144cce..ad8d7e34 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesGenerationsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs index 585a0ebf..bc012d43 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIImagesGenerationsIn { @@ -126,5 +126,6 @@ public OpenAIImagesGenerationsIn( public OpenAIImagesGenerationsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs deleted file mode 100644 index b2d55370..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesGenerationsInQuality - { - /// - /// 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.OpenAIImagesGenerationsInQuality? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesGenerationsInQuality), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInQuality; - } - - /// - /// 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.OpenAIImagesGenerationsInQuality? 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.OpenAIImagesGenerationsInQuality), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInQuality; - } - - /// - /// 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.OpenAIImagesGenerationsInQuality.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs deleted file mode 100644 index 87c00f8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The quality of the image that will be generated. - /// - public sealed partial class OpenAIImagesGenerationsInQuality - { - - /// - /// 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.OpenAIImagesGenerationsInResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.Json.g.cs deleted file mode 100644 index cb39d142..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesGenerationsInResponseFormat - { - /// - /// 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.OpenAIImagesGenerationsInResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesGenerationsInResponseFormat), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInResponseFormat; - } - - /// - /// 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.OpenAIImagesGenerationsInResponseFormat? 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.OpenAIImagesGenerationsInResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInResponseFormat; - } - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.Json.g.cs deleted file mode 100644 index b763207c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesGenerationsInStyle - { - /// - /// 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.OpenAIImagesGenerationsInStyle? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesGenerationsInStyle), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInStyle; - } - - /// - /// 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.OpenAIImagesGenerationsInStyle? 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.OpenAIImagesGenerationsInStyle), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInStyle; - } - - /// - /// 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.OpenAIImagesGenerationsInStyle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs deleted file mode 100644 index 21ba2e38..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The style of the generated images. - /// - public sealed partial class OpenAIImagesGenerationsInStyle - { - - /// - /// 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.OpenAIImagesGenerationsInUser.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.Json.g.cs deleted file mode 100644 index d22201ed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesGenerationsInUser - { - /// - /// 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.OpenAIImagesGenerationsInUser? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesGenerationsInUser), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInUser; - } - - /// - /// 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.OpenAIImagesGenerationsInUser? 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.OpenAIImagesGenerationsInUser), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInUser; - } - - /// - /// 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.OpenAIImagesGenerationsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs deleted file mode 100644 index 3db81b9a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - public sealed partial class OpenAIImagesGenerationsInUser - { - - /// - /// 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.OpenAIImagesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.Json.g.cs index 07898b25..7a684e0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs index abc11b13..fbf507ce 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIImagesOut { @@ -54,5 +54,6 @@ public OpenAIImagesOut( public OpenAIImagesOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesResponseFormat.g.cs index eb091517..b9fe30a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesResponseFormat.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public enum OpenAIImagesResponseFormat { /// - /// + /// /// B64Json, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.Json.g.cs index 9a0153c6..c2963985 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesVariationsIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesVariationsIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesVariationsIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs index 19a66750..12041012 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIImagesVariationsIn { @@ -116,5 +116,6 @@ public OpenAIImagesVariationsIn( public OpenAIImagesVariationsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs deleted file mode 100644 index c60a58df..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesVariationsInResponseFormat - { - /// - /// 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.OpenAIImagesVariationsInResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesVariationsInResponseFormat), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesVariationsInResponseFormat; - } - - /// - /// 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.OpenAIImagesVariationsInResponseFormat? 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.OpenAIImagesVariationsInResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesVariationsInResponseFormat; - } - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.Json.g.cs deleted file mode 100644 index 0a2d8aa7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAIImagesVariationsInUser - { - /// - /// 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.OpenAIImagesVariationsInUser? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAIImagesVariationsInUser), - jsonSerializerContext) as global::DeepInfra.OpenAIImagesVariationsInUser; - } - - /// - /// 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.OpenAIImagesVariationsInUser? 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.OpenAIImagesVariationsInUser), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesVariationsInUser; - } - - /// - /// 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.OpenAIImagesVariationsInUser.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs deleted file mode 100644 index d145adf9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - public sealed partial class OpenAIImagesVariationsInUser - { - - /// - /// 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.OpenAIModelOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.Json.g.cs index f0a528cb..af7d842c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIModelOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIModelOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIModelOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs index eb358842..c6bb39a0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIModelOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] @@ -22,34 +22,34 @@ public sealed partial class OpenAIModelOut public string? Object { 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("owned_by")] [global::System.Text.Json.Serialization.JsonRequired] public required string OwnedBy { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("root")] [global::System.Text.Json.Serialization.JsonRequired] public required string Root { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("parent")] public object? Parent { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("metadata")] public global::DeepInfra.ModelMetadata? Metadata { get; set; } @@ -99,5 +99,6 @@ public OpenAIModelOut( public OpenAIModelOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.Json.g.cs index c6ceae8e..ae1991df 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIModelOutMetadata; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIModelOutMetadata? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIModelOutMetadata; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs index b50bd221..502f92f2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIModelOutMetadata { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.Json.g.cs index d37376af..dcf55071 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIModelsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIModelsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIModelsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs index e5655c13..85b32afb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAIModelsOut { @@ -15,7 +15,7 @@ public sealed partial class OpenAIModelsOut public string? Object { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("data")] public global::System.Collections.Generic.IList? Data { get; set; } @@ -50,5 +50,6 @@ public OpenAIModelsOut( public OpenAIModelsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.Json.g.cs index f6cf55f6..bcdc6a81 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAITextToSpeechIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs index df7e1436..7dc73463 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs @@ -4,16 +4,23 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAITextToSpeechIn { /// - /// 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). + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. /// [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("fail_fast")] + public bool? FailFast { get; set; } + /// /// model name /// @@ -71,7 +78,11 @@ public sealed partial class OpenAITextToSpeechIn /// Text to convert to 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). + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false /// /// /// Preset voices to use for the speech. @@ -94,12 +105,14 @@ public OpenAITextToSpeechIn( string model, string input, global::DeepInfra.ServiceTier? serviceTier, + bool? failFast, string? voice, global::DeepInfra.TtsResponseFormat? responseFormat, double? speed, object? extraBody) { this.ServiceTier = serviceTier; + this.FailFast = failFast; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Input = input ?? throw new global::System.ArgumentNullException(nameof(input)); this.Voice = voice; @@ -114,5 +127,6 @@ public OpenAITextToSpeechIn( public OpenAITextToSpeechIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.Json.g.cs index 99e41825..17559170 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechInExtraBody; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAITextToSpeechInExtraBody? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechInExtraBody; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.Json.g.cs index b81dcdcf..63036498 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechInExtraBody2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAITextToSpeechInExtraBody2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechInExtraBody2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs index 03f59509..a2c36fa4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenAITextToSpeechInExtraBody2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.Json.g.cs deleted file mode 100644 index bd814680..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAITextToSpeechInServiceTier - { - /// - /// 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.OpenAITextToSpeechInServiceTier? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAITextToSpeechInServiceTier), - jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechInServiceTier; - } - - /// - /// 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.OpenAITextToSpeechInServiceTier? 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.OpenAITextToSpeechInServiceTier), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechInServiceTier; - } - - /// - /// 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.OpenAITextToSpeechInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs index 713d1a35..607e02ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// 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). + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. /// public sealed partial class OpenAITextToSpeechInServiceTier { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.Json.g.cs deleted file mode 100644 index 2784745d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenAITextToSpeechInVoice - { - /// - /// 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.OpenAITextToSpeechInVoice? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenAITextToSpeechInVoice), - jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechInVoice; - } - - /// - /// 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.OpenAITextToSpeechInVoice? 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.OpenAITextToSpeechInVoice), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechInVoice; - } - - /// - /// 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.OpenAITextToSpeechInVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs deleted file mode 100644 index 42363541..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Preset voices to use for the speech. - /// - public sealed partial class OpenAITextToSpeechInVoice - { - - /// - /// 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..d8110688 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawLaunchTokenOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenClawLaunchTokenOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenClawLaunchTokenOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawLaunchTokenOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..26f7160c --- /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.OpenRouterDatacenter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.Json.g.cs deleted file mode 100644 index 8bf7a3f4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenRouterDatacenter - { - /// - /// 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.OpenRouterDatacenter? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenRouterDatacenter), - jsonSerializerContext) as global::DeepInfra.OpenRouterDatacenter; - } - - /// - /// 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.OpenRouterDatacenter? 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.OpenRouterDatacenter), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterDatacenter; - } - - /// - /// 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.OpenRouterDatacenter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs deleted file mode 100644 index cc1f3555..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs +++ /dev/null @@ -1,46 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenRouterDatacenter - { - /// - /// ISO 3166 Alpha-2 country code - /// - [global::System.Text.Json.Serialization.JsonPropertyName("country_code")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string CountryCode { 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. - /// - /// - /// ISO 3166 Alpha-2 country code - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public OpenRouterDatacenter( - string countryCode) - { - this.CountryCode = countryCode ?? throw new global::System.ArgumentNullException(nameof(countryCode)); - } - - /// - /// Initializes a new instance of the class. - /// - public OpenRouterDatacenter() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs deleted file mode 100644 index 5e0028c7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenRouterModelData - { - /// - /// 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.OpenRouterModelData? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenRouterModelData), - jsonSerializerContext) as global::DeepInfra.OpenRouterModelData; - } - - /// - /// 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.OpenRouterModelData? 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.OpenRouterModelData), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelData; - } - - /// - /// 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.OpenRouterModelData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs deleted file mode 100644 index 33de60f8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs +++ /dev/null @@ -1,188 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenRouterModelData - { - /// - /// Model identifier - /// - [global::System.Text.Json.Serialization.JsonPropertyName("id")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Id { get; set; } - - /// - /// Human-readable model name - /// - [global::System.Text.Json.Serialization.JsonPropertyName("name")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Name { get; set; } - - /// - /// Supported input modalities - /// - [global::System.Text.Json.Serialization.JsonPropertyName("input_modalities")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList InputModalities { get; set; } - - /// - /// Supported output modalities - /// - [global::System.Text.Json.Serialization.JsonPropertyName("output_modalities")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList OutputModalities { get; set; } - - /// - /// Model quantization type - /// - [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Quantization { get; set; } - - /// - /// Maximum context length - /// - [global::System.Text.Json.Serialization.JsonPropertyName("context_length")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int ContextLength { get; set; } - - /// - /// Maximum output length - /// - [global::System.Text.Json.Serialization.JsonPropertyName("max_output_length")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int MaxOutputLength { get; set; } - - /// - /// Pricing information - /// - [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.OpenRouterPricing Pricing { get; set; } - - /// - /// Supported sampling parameters - /// - [global::System.Text.Json.Serialization.JsonPropertyName("supported_sampling_parameters")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList SupportedSamplingParameters { get; set; } - - /// - /// Supported features - /// - [global::System.Text.Json.Serialization.JsonPropertyName("supported_features")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList SupportedFeatures { get; set; } - - /// - /// Model description - /// - [global::System.Text.Json.Serialization.JsonPropertyName("description")] - public string? Description { get; set; } - - /// - /// OpenRouter specific data - /// - [global::System.Text.Json.Serialization.JsonPropertyName("openrouter")] - public global::System.Collections.Generic.Dictionary? Openrouter { get; set; } - - /// - /// Available datacenters - /// - [global::System.Text.Json.Serialization.JsonPropertyName("datacenters")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Datacenters { 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. - /// - /// - /// Model identifier - /// - /// - /// Human-readable model name - /// - /// - /// Supported input modalities - /// - /// - /// Supported output modalities - /// - /// - /// Model quantization type - /// - /// - /// Maximum context length - /// - /// - /// Maximum output length - /// - /// - /// Pricing information - /// - /// - /// Supported sampling parameters - /// - /// - /// Supported features - /// - /// - /// Available datacenters - /// - /// - /// Model description - /// - /// - /// OpenRouter specific data - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public OpenRouterModelData( - string id, - string name, - global::System.Collections.Generic.IList inputModalities, - global::System.Collections.Generic.IList outputModalities, - string quantization, - int contextLength, - int maxOutputLength, - global::DeepInfra.OpenRouterPricing pricing, - global::System.Collections.Generic.IList supportedSamplingParameters, - global::System.Collections.Generic.IList supportedFeatures, - global::System.Collections.Generic.IList datacenters, - string? description, - global::System.Collections.Generic.Dictionary? openrouter) - { - this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); - this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); - 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)); - this.ContextLength = contextLength; - this.MaxOutputLength = maxOutputLength; - this.Pricing = pricing ?? throw new global::System.ArgumentNullException(nameof(pricing)); - this.SupportedSamplingParameters = supportedSamplingParameters ?? throw new global::System.ArgumentNullException(nameof(supportedSamplingParameters)); - this.SupportedFeatures = supportedFeatures ?? throw new global::System.ArgumentNullException(nameof(supportedFeatures)); - this.Description = description; - this.Openrouter = openrouter; - this.Datacenters = datacenters ?? throw new global::System.ArgumentNullException(nameof(datacenters)); - } - - /// - /// Initializes a new instance of the class. - /// - public OpenRouterModelData() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs deleted file mode 100644 index 9ed2b8f4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenRouterModelDataDescription - { - /// - /// 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.OpenRouterModelDataDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenRouterModelDataDescription), - jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataDescription; - } - - /// - /// 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.OpenRouterModelDataDescription? 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.OpenRouterModelDataDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataDescription; - } - - /// - /// 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.OpenRouterModelDataDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs deleted file mode 100644 index 8d34a432..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Model description - /// - public sealed partial class OpenRouterModelDataDescription - { - - /// - /// 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.OpenRouterModelDataOpenrouter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.Json.g.cs deleted file mode 100644 index bde6fd64..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenRouterModelDataOpenrouter - { - /// - /// 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.OpenRouterModelDataOpenrouter? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenRouterModelDataOpenrouter), - jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataOpenrouter; - } - - /// - /// 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.OpenRouterModelDataOpenrouter? 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.OpenRouterModelDataOpenrouter), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataOpenrouter; - } - - /// - /// 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.OpenRouterModelDataOpenrouter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs deleted file mode 100644 index baaa3b3f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// OpenRouter specific data - /// - public sealed partial class OpenRouterModelDataOpenrouter - { - - /// - /// 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.OpenRouterModelDataOpenrouter2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.Json.g.cs deleted file mode 100644 index 016144d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenRouterModelDataOpenrouter2 - { - /// - /// 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.OpenRouterModelDataOpenrouter2? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenRouterModelDataOpenrouter2), - jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataOpenrouter2; - } - - /// - /// 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.OpenRouterModelDataOpenrouter2? 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.OpenRouterModelDataOpenrouter2), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataOpenrouter2; - } - - /// - /// 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.OpenRouterModelDataOpenrouter2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs deleted file mode 100644 index 1c889483..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenRouterModelDataOpenrouter2 - { - - /// - /// 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.OpenRouterModelsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.Json.g.cs index 68d0d9a3..49c046be 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterModelsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs index 6494fc21..d779e4a9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenRouterModelsOut { @@ -13,7 +13,7 @@ public sealed partial class OpenRouterModelsOut /// [global::System.Text.Json.Serialization.JsonPropertyName("data")] [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList Data { get; set; } + public required global::System.Collections.Generic.IList Data { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -31,7 +31,7 @@ public sealed partial class OpenRouterModelsOut [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public OpenRouterModelsOut( - global::System.Collections.Generic.IList data) + global::System.Collections.Generic.IList data) { this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); } @@ -42,5 +42,6 @@ public OpenRouterModelsOut( public OpenRouterModelsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOutDataItem.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOutDataItem.Json.g.cs new file mode 100644 index 00000000..c89fc38c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOutDataItem.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenRouterModelsOutDataItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelsOutDataItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenRouterModelsOutDataItem), + jsonSerializerContext) as global::DeepInfra.OpenRouterModelsOutDataItem; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelsOutDataItem? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenRouterModelsOutDataItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenRouterModelsOutDataItem), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelsOutDataItem; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOutDataItem.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOutDataItem.g.cs new file mode 100644 index 00000000..ad193a2a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOutDataItem.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenRouterModelsOutDataItem + { + + /// + /// 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.OpenRouterPricing.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.Json.g.cs deleted file mode 100644 index 5482fc29..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenRouterPricing - { - /// - /// 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.OpenRouterPricing? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenRouterPricing), - jsonSerializerContext) as global::DeepInfra.OpenRouterPricing; - } - - /// - /// 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.OpenRouterPricing? 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.OpenRouterPricing), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterPricing; - } - - /// - /// 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.OpenRouterPricing.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs deleted file mode 100644 index 43b35a65..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs +++ /dev/null @@ -1,58 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenRouterPricing - { - /// - /// Pricing per 1 token for input - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// Pricing per 1 token for output - /// - [global::System.Text.Json.Serialization.JsonPropertyName("completion")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Completion { 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. - /// - /// - /// Pricing per 1 token for input - /// - /// - /// Pricing per 1 token for output - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public OpenRouterPricing( - string prompt, - string completion) - { - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Completion = completion ?? throw new global::System.ArgumentNullException(nameof(completion)); - } - - /// - /// Initializes a new instance of the class. - /// - public OpenRouterPricing() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.Json.g.cs index 04d3ee38..75ab27eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs index 9a1c4d64..1edbb8df 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index cf6c71aa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource - { - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource; - } - - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource? 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.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource; - } - - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs deleted file mode 100644 index 5fdfd59c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource - { - - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs deleted file mode 100644 index 07780b57..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXiApiKey - { - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey; - } - - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey? 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.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey; - } - - /// - /// 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.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs deleted file mode 100644 index a89fa4c3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.Json.g.cs index 48e2a1c3..6d0ac0db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs index 80760374..1053a746 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 7d06180b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource - { - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource? 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs deleted file mode 100644 index a000f22b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource - { - - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs deleted file mode 100644 index e5d59adb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey - { - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey; - } - - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey? 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey; - } - - /// - /// 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs deleted file mode 100644 index 91d10003..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.Json.g.cs index a97f80b3..87eaa46e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs index bb8d4dfb..8e514cea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 8d5f52ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource - { - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource? 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.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs deleted file mode 100644 index d716f614..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource - { - - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs deleted file mode 100644 index c2c7e28c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey - { - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey; - } - - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey? 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.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey; - } - - /// - /// 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.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs deleted file mode 100644 index df1b1d13..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.Json.g.cs index 271934db..68313c54 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs index 5f782f21..ec989cc2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index f4ccf123..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource - { - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource? 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.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs deleted file mode 100644 index a49ed09e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource - { - - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs deleted file mode 100644 index a34481ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey - { - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey; - } - - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey? 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.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey; - } - - /// - /// 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.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs deleted file mode 100644 index 7b82d7e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.Json.g.cs index 59766695..ea1be895 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiCompletionsV1CompletionsPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs index 57920d94..70d0528a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiCompletionsV1CompletionsPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 920346c9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1CompletionsPostXDeepinfraSource - { - /// - /// 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.OpenaiCompletionsV1CompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1CompletionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiCompletionsV1CompletionsPostXDeepinfraSource? 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.OpenaiCompletionsV1CompletionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs deleted file mode 100644 index c043e8c5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1CompletionsPostXDeepinfraSource - { - - /// - /// 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.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs deleted file mode 100644 index d49d2b92..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1CompletionsPostXiApiKey - { - /// - /// 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.OpenaiCompletionsV1CompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1CompletionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXiApiKey; - } - - /// - /// 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.OpenaiCompletionsV1CompletionsPostXiApiKey? 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.OpenaiCompletionsV1CompletionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXiApiKey; - } - - /// - /// 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.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs deleted file mode 100644 index 4110e179..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1CompletionsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.Json.g.cs index e250456a..71e6f337 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs index eb76f509..61d3ae6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.Json.g.cs deleted file mode 100644 index 3b23437c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostUserAgent - { - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostUserAgent? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostUserAgent), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostUserAgent; - } - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostUserAgent? 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.OpenaiEmbeddingsV1EmbeddingsPostUserAgent), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostUserAgent; - } - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs deleted file mode 100644 index 0ce2adde..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostUserAgent - { - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index d66c79d6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource - { - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource? 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.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource; - } - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs deleted file mode 100644 index 0029c5c9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource - { - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs deleted file mode 100644 index f9a610c6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXiApiKey - { - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey; - } - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey? 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.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey; - } - - /// - /// 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.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs deleted file mode 100644 index b4afd60f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.Json.g.cs index 35207a5f..bf77efc4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1FilesPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiFilesV1FilesPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1FilesPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs index 9cdaacdb..2743b355 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class OpenaiFilesV1FilesPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.Json.g.cs deleted file mode 100644 index 07e45697..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiFilesV1FilesPostXiApiKey - { - /// - /// 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.OpenaiFilesV1FilesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiFilesV1FilesPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1FilesPostXiApiKey; - } - - /// - /// 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.OpenaiFilesV1FilesPostXiApiKey? 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.OpenaiFilesV1FilesPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1FilesPostXiApiKey; - } - - /// - /// 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.OpenaiFilesV1FilesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs deleted file mode 100644 index 6e20b0ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiFilesV1FilesPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.Json.g.cs deleted file mode 100644 index 881b6e92..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesEditsV1ImagesEditsPostXiApiKey - { - /// - /// 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.OpenaiImagesEditsV1ImagesEditsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXiApiKey; - } - - /// - /// 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.OpenaiImagesEditsV1ImagesEditsPostXiApiKey? 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.OpenaiImagesEditsV1ImagesEditsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXiApiKey; - } - - /// - /// 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.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs deleted file mode 100644 index 0c9392b5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesEditsV1ImagesEditsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.Json.g.cs deleted file mode 100644 index 50c80f3a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey - { - /// - /// 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.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey; - } - - /// - /// 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.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey? 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.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey; - } - - /// - /// 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.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs deleted file mode 100644 index 3c84784c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.Json.g.cs deleted file mode 100644 index b3c3209d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey - { - /// - /// 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.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey; - } - - /// - /// 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.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey? 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.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey; - } - - /// - /// 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.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs deleted file mode 100644 index 4c247057..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey - { - - /// - /// 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.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.OpenaiModelsV1ModelsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.Json.g.cs deleted file mode 100644 index 1475db58..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiModelsV1ModelsGetXiApiKey - { - /// - /// 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.OpenaiModelsV1ModelsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiModelsV1ModelsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetXiApiKey; - } - - /// - /// 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.OpenaiModelsV1ModelsGetXiApiKey? 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.OpenaiModelsV1ModelsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetXiApiKey; - } - - /// - /// 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.OpenaiModelsV1ModelsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs deleted file mode 100644 index 81c870c6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiModelsV1ModelsGetXiApiKey - { - - /// - /// 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.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.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs new file mode 100644 index 00000000..94d4c318 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..a70b0e84 --- /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.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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs new file mode 100644 index 00000000..3417a034 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..55f8071b --- /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.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs new file mode 100644 index 00000000..8acca8b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..a37cf42f --- /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.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs new file mode 100644 index 00000000..135ed9b0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..15dd5774 --- /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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs new file mode 100644 index 00000000..7890b866 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..29766503 --- /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.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs new file mode 100644 index 00000000..bd3b8f59 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..5ade8b44 --- /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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs new file mode 100644 index 00000000..a7c0d7b2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..da61f5c6 --- /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.PaymentMethodBank.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBank.Json.g.cs new file mode 100644 index 00000000..50b6128c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBank.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodBank + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBank? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodBank), + jsonSerializerContext) as global::DeepInfra.PaymentMethodBank; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBank? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodBank? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodBank), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodBank; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBank.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBank.g.cs new file mode 100644 index 00000000..c5723482 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBank.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodBank + { + /// + /// + /// + [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 PaymentMethodBank( + string? bankName, + string? last4) + { + this.BankName = bankName; + this.Last4 = last4; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodBank() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCard.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCard.Json.g.cs new file mode 100644 index 00000000..ae1bc663 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCard.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCard + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCard? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCard), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCard; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCard? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodCard? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodCard), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCard; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCard.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCard.g.cs new file mode 100644 index 00000000..a6d8df00 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCard.g.cs @@ -0,0 +1,62 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCard + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("brand")] + public string? Brand { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last4")] + public string? Last4 { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("wallet")] + public string? Wallet { 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 PaymentMethodCard( + string? brand, + string? last4, + string? wallet) + { + this.Brand = brand; + this.Last4 = last4; + this.Wallet = wallet; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodCard() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashApp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashApp.Json.g.cs new file mode 100644 index 00000000..5de10679 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashApp.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCashApp + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCashApp? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCashApp), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCashApp; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCashApp? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodCashApp? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodCashApp), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCashApp; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashApp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashApp.g.cs new file mode 100644 index 00000000..ff405979 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashApp.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCashApp + { + /// + /// + /// + [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 PaymentMethodCashApp( + string? cashtag) + { + this.Cashtag = cashtag; + } + + /// + /// Initializes a new instance of the class. + /// + public PaymentMethodCashApp() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOut.Json.g.cs new file mode 100644 index 00000000..c38da69b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodOut), + jsonSerializerContext) as global::DeepInfra.PaymentMethodOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOut.g.cs new file mode 100644 index 00000000..e838ff67 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOut.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodOut + { + /// + /// + /// + [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.PaymentMethodCard? Card { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("us_bank_account")] + public global::DeepInfra.PaymentMethodBank? UsBankAccount { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cashapp")] + public global::DeepInfra.PaymentMethodCashApp? 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 PaymentMethodOut( + string type, + global::DeepInfra.PaymentMethodCard? card, + global::DeepInfra.PaymentMethodBank? usBankAccount, + global::DeepInfra.PaymentMethodCashApp? 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 PaymentMethodOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCard.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCard.Json.g.cs new file mode 100644 index 00000000..4192c8fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCard.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodOutCard + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOutCard? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodOutCard), + jsonSerializerContext) as global::DeepInfra.PaymentMethodOutCard; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOutCard? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodOutCard? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodOutCard), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodOutCard; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCard.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCard.g.cs new file mode 100644 index 00000000..0fc0fe11 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCard.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodOutCard + { + + /// + /// 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.PaymentMethodOutCashapp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCashapp.Json.g.cs new file mode 100644 index 00000000..dce68a85 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCashapp.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodOutCashapp + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOutCashapp? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodOutCashapp), + jsonSerializerContext) as global::DeepInfra.PaymentMethodOutCashapp; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOutCashapp? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodOutCashapp? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodOutCashapp), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodOutCashapp; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCashapp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCashapp.g.cs new file mode 100644 index 00000000..1c201f56 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutCashapp.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodOutCashapp + { + + /// + /// 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.PaymentMethodOutUsBankAccount.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutUsBankAccount.Json.g.cs new file mode 100644 index 00000000..69d9f16f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutUsBankAccount.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodOutUsBankAccount + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOutUsBankAccount? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodOutUsBankAccount), + jsonSerializerContext) as global::DeepInfra.PaymentMethodOutUsBankAccount; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodOutUsBankAccount? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PaymentMethodOutUsBankAccount? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PaymentMethodOutUsBankAccount), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodOutUsBankAccount; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutUsBankAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutUsBankAccount.g.cs new file mode 100644 index 00000000..6c9cf4f1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodOutUsBankAccount.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodOutUsBankAccount + { + + /// + /// 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.PresetConfigOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOut.Json.g.cs new file mode 100644 index 00000000..d3e49096 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PresetConfigOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PresetConfigOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PresetConfigOut), + jsonSerializerContext) as global::DeepInfra.PresetConfigOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PresetConfigOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PresetConfigOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PresetConfigOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PresetConfigOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOut.g.cs new file mode 100644 index 00000000..e6399f9d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOut.g.cs @@ -0,0 +1,118 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// One preset deploy config for an HF model on specific hardware. + /// + public sealed partial class PresetConfigOut + { + /// + /// Preset id. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Config source.
+ /// Default Value: deepinfra + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("source")] + public string? Source { get; set; } + + /// + /// Inference engine.
+ /// Default Value: vllm + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("engine")] + public string? Engine { get; set; } + + /// + /// Allowed Nx<GPU> configs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_configs")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList GpuConfigs { get; set; } + + /// + /// Engine tuning knobs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + public global::DeepInfra.PresetConfigOutStandardArgs? StandardArgs { get; set; } + + /// + /// Raw engine flags; vLLM recipes only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("extra_args")] + public global::System.Collections.Generic.IList? ExtraArgs { get; set; } + + /// + /// Short display name (e.g. "Throughput-optimized"). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("label")] + public string? Label { 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. + /// + /// + /// Preset id. + /// + /// + /// Allowed Nx<GPU> configs. + /// + /// + /// Config source.
+ /// Default Value: deepinfra + /// + /// + /// Inference engine.
+ /// Default Value: vllm + /// + /// + /// Engine tuning knobs. + /// + /// + /// Raw engine flags; vLLM recipes only. + /// + /// + /// Short display name (e.g. "Throughput-optimized"). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PresetConfigOut( + string id, + global::System.Collections.Generic.IList gpuConfigs, + string? source, + string? engine, + global::DeepInfra.PresetConfigOutStandardArgs? standardArgs, + global::System.Collections.Generic.IList? extraArgs, + string? label) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Source = source; + this.Engine = engine; + this.GpuConfigs = gpuConfigs ?? throw new global::System.ArgumentNullException(nameof(gpuConfigs)); + this.StandardArgs = standardArgs; + this.ExtraArgs = extraArgs; + this.Label = label; + } + + /// + /// Initializes a new instance of the class. + /// + public PresetConfigOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.Json.g.cs new file mode 100644 index 00000000..5531207d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PresetConfigOutStandardArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PresetConfigOutStandardArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PresetConfigOutStandardArgs), + jsonSerializerContext) as global::DeepInfra.PresetConfigOutStandardArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PresetConfigOutStandardArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PresetConfigOutStandardArgs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PresetConfigOutStandardArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PresetConfigOutStandardArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.g.cs new file mode 100644 index 00000000..bf5abca5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.g.cs @@ -0,0 +1,112 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Engine tuning knobs. + /// + public sealed partial class PresetConfigOutStandardArgs + { + /// + /// Maximum total sequence length (prompt + generation). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_context_size")] + public int? MaxContextSize { get; set; } + + /// + /// Max number of requests served concurrently. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_concurrent_requests")] + public int? MaxConcurrentRequests { get; set; } + + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_memory_fraction")] + public double? GpuMemoryFraction { get; set; } + + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_prefill_tokens")] + public int? MaxPrefillTokens { get; set; } + + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("kv_cache_dtype")] + public global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2? KvCacheDtype { get; set; } + + /// + /// Reuse KV cache for shared prompt prefixes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_prefix_caching")] + public bool? EnablePrefixCaching { get; set; } + + /// + /// On-the-fly weight quantization method. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] + public global::DeepInfra.PresetConfigOutStandardArgsQuantization2? Quantization { 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. + /// + /// + /// Maximum total sequence length (prompt + generation). + /// + /// + /// Max number of requests served concurrently. + /// + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + /// + /// Reuse KV cache for shared prompt prefixes. + /// + /// + /// On-the-fly weight quantization method. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PresetConfigOutStandardArgs( + int? maxContextSize, + int? maxConcurrentRequests, + double? gpuMemoryFraction, + int? maxPrefillTokens, + global::DeepInfra.PresetConfigOutStandardArgsKvCacheDtype2? kvCacheDtype, + bool? enablePrefixCaching, + global::DeepInfra.PresetConfigOutStandardArgsQuantization2? quantization) + { + this.MaxContextSize = maxContextSize; + this.MaxConcurrentRequests = maxConcurrentRequests; + this.GpuMemoryFraction = gpuMemoryFraction; + this.MaxPrefillTokens = maxPrefillTokens; + this.KvCacheDtype = kvCacheDtype; + this.EnablePrefixCaching = enablePrefixCaching; + this.Quantization = quantization; + } + + /// + /// Initializes a new instance of the class. + /// + public PresetConfigOutStandardArgs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsKvCacheDtype.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsKvCacheDtype.g.cs new file mode 100644 index 00000000..21e37914 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsKvCacheDtype.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + public sealed partial class PresetConfigOutStandardArgsKvCacheDtype + { + + /// + /// 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.PresetConfigOutStandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..3471833a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsKvCacheDtype2.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum PresetConfigOutStandardArgsKvCacheDtype2 + { + /// + /// + /// + Auto, + /// + /// + /// + Fp8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PresetConfigOutStandardArgsKvCacheDtype2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PresetConfigOutStandardArgsKvCacheDtype2 value) + { + return value switch + { + PresetConfigOutStandardArgsKvCacheDtype2.Auto => "auto", + PresetConfigOutStandardArgsKvCacheDtype2.Fp8 => "fp8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PresetConfigOutStandardArgsKvCacheDtype2? ToEnum(string value) + { + return value switch + { + "auto" => PresetConfigOutStandardArgsKvCacheDtype2.Auto, + "fp8" => PresetConfigOutStandardArgsKvCacheDtype2.Fp8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsQuantization.g.cs new file mode 100644 index 00000000..3e3ecf07 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsQuantization.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// On-the-fly weight quantization method. + /// + public sealed partial class PresetConfigOutStandardArgsQuantization + { + + /// + /// 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.PresetConfigOutStandardArgsQuantization2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsQuantization2.g.cs new file mode 100644 index 00000000..88ad0a25 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgsQuantization2.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum PresetConfigOutStandardArgsQuantization2 + { + /// + /// + /// + Awq, + /// + /// + /// + AwqMarlin, + /// + /// + /// + Bitsandbytes, + /// + /// + /// + CompressedTensors, + /// + /// + /// + Fp8, + /// + /// + /// + Gptq, + /// + /// + /// + GptqMarlin, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PresetConfigOutStandardArgsQuantization2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PresetConfigOutStandardArgsQuantization2 value) + { + return value switch + { + PresetConfigOutStandardArgsQuantization2.Awq => "awq", + PresetConfigOutStandardArgsQuantization2.AwqMarlin => "awq_marlin", + PresetConfigOutStandardArgsQuantization2.Bitsandbytes => "bitsandbytes", + PresetConfigOutStandardArgsQuantization2.CompressedTensors => "compressed-tensors", + PresetConfigOutStandardArgsQuantization2.Fp8 => "fp8", + PresetConfigOutStandardArgsQuantization2.Gptq => "gptq", + PresetConfigOutStandardArgsQuantization2.GptqMarlin => "gptq_marlin", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PresetConfigOutStandardArgsQuantization2? ToEnum(string value) + { + return value switch + { + "awq" => PresetConfigOutStandardArgsQuantization2.Awq, + "awq_marlin" => PresetConfigOutStandardArgsQuantization2.AwqMarlin, + "bitsandbytes" => PresetConfigOutStandardArgsQuantization2.Bitsandbytes, + "compressed-tensors" => PresetConfigOutStandardArgsQuantization2.CompressedTensors, + "fp8" => PresetConfigOutStandardArgsQuantization2.Fp8, + "gptq" => PresetConfigOutStandardArgsQuantization2.Gptq, + "gptq_marlin" => PresetConfigOutStandardArgsQuantization2.GptqMarlin, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.Json.g.cs index 113ede25..30fdec4d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.PricingPageEntryOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PricingPageEntryOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PricingPageEntryOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs index 9929f4f1..3faca7a0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class PricingPageEntryOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] [global::System.Text.Json.Serialization.JsonRequired] public required string ModelName { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("short_name")] [global::System.Text.Json.Serialization.JsonRequired] @@ -29,12 +29,12 @@ public sealed partial class PricingPageEntryOut public int? MaxTokens { get; set; } /// - /// + /// /// [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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.Json.g.cs deleted file mode 100644 index fbd3b508..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class PricingPageEntryOutMaxTokens - { - /// - /// 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.PricingPageEntryOutMaxTokens? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.PricingPageEntryOutMaxTokens), - jsonSerializerContext) as global::DeepInfra.PricingPageEntryOutMaxTokens; - } - - /// - /// 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.PricingPageEntryOutMaxTokens? 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.PricingPageEntryOutMaxTokens), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PricingPageEntryOutMaxTokens; - } - - /// - /// 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.PricingPageEntryOutMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs deleted file mode 100644 index 07193d18..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// The maximum context size of this model, if applicable - /// - public sealed partial class PricingPageEntryOutMaxTokens - { - - /// - /// 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.PricingPageSectionOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.Json.g.cs index b2225ba9..b99dd377 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.PricingPageSectionOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PricingPageSectionOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PricingPageSectionOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs index c4aa0b83..99a93707 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class PricingPageSectionOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("section_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string SectionId { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("ptype")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.PricingTypeJsonConverter))] @@ -24,14 +24,14 @@ public sealed partial class PricingPageSectionOut public required global::DeepInfra.PricingType Ptype { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("title")] [global::System.Text.Json.Serialization.JsonRequired] public required string Title { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("description")] [global::System.Text.Json.Serialization.JsonRequired] @@ -44,7 +44,7 @@ public sealed partial class PricingPageSectionOut public string? MfDescription { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("entries")] [global::System.Text.Json.Serialization.JsonRequired] @@ -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..451342b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs @@ -4,40 +4,44 @@ namespace DeepInfra { /// - /// + /// /// public enum PricingType { /// - /// + /// + /// + FrameUnits, + /// + /// /// ImageUnits, /// - /// + /// /// InputCharacterLength, /// - /// + /// /// InputLength, /// - /// + /// /// InputTokens, /// - /// + /// /// OutputLength, /// - /// + /// /// Time, /// - /// + /// /// Tokens, /// - /// + /// /// Uptime, } @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.Json.g.cs deleted file mode 100644 index fcd12bca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class PrivateModelsListModelsPrivateListGetXiApiKey - { - /// - /// 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.PrivateModelsListModelsPrivateListGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.PrivateModelsListModelsPrivateListGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.PrivateModelsListModelsPrivateListGetXiApiKey; - } - - /// - /// 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.PrivateModelsListModelsPrivateListGetXiApiKey? 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.PrivateModelsListModelsPrivateListGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PrivateModelsListModelsPrivateListGetXiApiKey; - } - - /// - /// 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.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs deleted file mode 100644 index 28258c6b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class PrivateModelsListModelsPrivateListGetXiApiKey - { - - /// - /// 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.PromptCacheBreakpoint.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheBreakpoint.Json.g.cs new file mode 100644 index 00000000..34316c4b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheBreakpoint.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PromptCacheBreakpoint + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PromptCacheBreakpoint? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PromptCacheBreakpoint), + jsonSerializerContext) as global::DeepInfra.PromptCacheBreakpoint; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PromptCacheBreakpoint? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PromptCacheBreakpoint? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PromptCacheBreakpoint), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PromptCacheBreakpoint; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheBreakpoint.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheBreakpoint.g.cs new file mode 100644 index 00000000..feff200d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheBreakpoint.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PromptCacheBreakpoint + { + /// + /// Breakpoint mode; 'explicit' bounds cache retention to the prompt prefix ending at this content part. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mode")] + public string? Mode { 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. + /// + /// + /// Breakpoint mode; 'explicit' bounds cache retention to the prompt prefix ending at this content part. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PromptCacheBreakpoint( + string? mode) + { + this.Mode = mode; + } + + /// + /// Initializes a new instance of the class. + /// + public PromptCacheBreakpoint() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptions.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptions.Json.g.cs new file mode 100644 index 00000000..fd089084 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptions.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PromptCacheOptions + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.PromptCacheOptions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PromptCacheOptions), + jsonSerializerContext) as global::DeepInfra.PromptCacheOptions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PromptCacheOptions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.PromptCacheOptions? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.PromptCacheOptions), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PromptCacheOptions; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptions.g.cs new file mode 100644 index 00000000..5a9d8eec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptions.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PromptCacheOptions + { + /// + /// Prompt caching mode; 'explicit' requests explicit caching. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mode")] + public global::DeepInfra.PromptCacheOptionsMode2? Mode { get; set; } + + /// + /// Requested cache retention for this request's prefix. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ttl")] + public global::DeepInfra.PromptCacheOptionsTtl2? Ttl { 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. + /// + /// + /// Prompt caching mode; 'explicit' requests explicit caching. + /// + /// + /// Requested cache retention for this request's prefix. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public PromptCacheOptions( + global::DeepInfra.PromptCacheOptionsMode2? mode, + global::DeepInfra.PromptCacheOptionsTtl2? ttl) + { + this.Mode = mode; + this.Ttl = ttl; + } + + /// + /// Initializes a new instance of the class. + /// + public PromptCacheOptions() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsMode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsMode.g.cs new file mode 100644 index 00000000..5d6076ec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsMode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Prompt caching mode; 'explicit' requests explicit caching. + /// + public sealed partial class PromptCacheOptionsMode + { + + /// + /// 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.PromptCacheOptionsMode2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsMode2.g.cs new file mode 100644 index 00000000..223e2a2e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsMode2.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum PromptCacheOptionsMode2 + { + /// + /// + /// + Explicit, + /// + /// + /// + Implicit, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PromptCacheOptionsMode2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PromptCacheOptionsMode2 value) + { + return value switch + { + PromptCacheOptionsMode2.Explicit => "explicit", + PromptCacheOptionsMode2.Implicit => "implicit", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PromptCacheOptionsMode2? ToEnum(string value) + { + return value switch + { + "explicit" => PromptCacheOptionsMode2.Explicit, + "implicit" => PromptCacheOptionsMode2.Implicit, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsTtl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsTtl.g.cs new file mode 100644 index 00000000..07bfa4e6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsTtl.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Requested cache retention for this request's prefix. + /// + public sealed partial class PromptCacheOptionsTtl + { + + /// + /// 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.PromptCacheOptionsTtl2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsTtl2.g.cs new file mode 100644 index 00000000..781df073 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PromptCacheOptionsTtl2.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum PromptCacheOptionsTtl2 + { + /// + /// + /// + x1h, + /// + /// + /// + x5m, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class PromptCacheOptionsTtl2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this PromptCacheOptionsTtl2 value) + { + return value switch + { + PromptCacheOptionsTtl2.x1h => "1h", + PromptCacheOptionsTtl2.x5m => "5m", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static PromptCacheOptionsTtl2? ToEnum(string value) + { + return value switch + { + "1h" => PromptCacheOptionsTtl2.x1h, + "5m" => PromptCacheOptionsTtl2.x5m, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.Json.g.cs index 5ac8e683..46c51218 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RateLimitOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RateLimitOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RateLimitOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs index 512ab873..bc9337ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RateLimitOut { @@ -54,5 +54,6 @@ public RateLimitOut( public RateLimitOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.Json.g.cs index e55693f2..472040c5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RateLimitRequestIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RateLimitRequestIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RateLimitRequestIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs index 9cc791c3..e6d5b9c8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs @@ -4,25 +4,25 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RateLimitRequestIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("rate_limit")] [global::System.Text.Json.Serialization.JsonRequired] public required int RateLimit { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("tpm_rate_limit")] public int? TpmRateLimit { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("reason")] [global::System.Text.Json.Serialization.JsonRequired] @@ -59,5 +59,6 @@ public RateLimitRequestIn( public RateLimitRequestIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs deleted file mode 100644 index 1a09be4e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RateLimitRequestInTpmRateLimit - { - /// - /// 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.RateLimitRequestInTpmRateLimit? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RateLimitRequestInTpmRateLimit), - jsonSerializerContext) as global::DeepInfra.RateLimitRequestInTpmRateLimit; - } - - /// - /// 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.RateLimitRequestInTpmRateLimit? 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.RateLimitRequestInTpmRateLimit), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RateLimitRequestInTpmRateLimit; - } - - /// - /// 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.RateLimitRequestInTpmRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs deleted file mode 100644 index c268c60c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RateLimitRequestInTpmRateLimit - { - - /// - /// 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.RebalanceCancelIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelIn.Json.g.cs new file mode 100644 index 00000000..4ec1a9ed --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceCancelIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceCancelIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceCancelIn), + jsonSerializerContext) as global::DeepInfra.RebalanceCancelIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceCancelIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceCancelIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceCancelIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceCancelIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelIn.g.cs new file mode 100644 index 00000000..caaebf91 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelIn.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RebalanceCancelIn + { + /// + /// Rebalance to cancel; defaults to the active one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("replace_id")] + public string? ReplaceId { 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. + /// + /// + /// Rebalance to cancel; defaults to the active one. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RebalanceCancelIn( + string? replaceId) + { + this.ReplaceId = replaceId; + } + + /// + /// Initializes a new instance of the class. + /// + public RebalanceCancelIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelOut.Json.g.cs new file mode 100644 index 00000000..a8f5efd3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceCancelOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceCancelOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceCancelOut), + jsonSerializerContext) as global::DeepInfra.RebalanceCancelOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceCancelOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceCancelOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceCancelOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceCancelOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelOut.g.cs new file mode 100644 index 00000000..0984e514 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceCancelOut.g.cs @@ -0,0 +1,71 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RebalanceCancelOut + { + /// + /// Id of the cancelled rebalance. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("replace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ReplaceId { get; set; } + + /// + /// Target instances delivered before the cancel. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("placed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Placed { get; set; } + + /// + /// Target instances requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Count { 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. + /// + /// + /// Id of the cancelled rebalance. + /// + /// + /// Target instances delivered before the cancel. + /// + /// + /// Target instances requested. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RebalanceCancelOut( + string replaceId, + int placed, + int count) + { + this.ReplaceId = replaceId ?? throw new global::System.ArgumentNullException(nameof(replaceId)); + this.Placed = placed; + this.Count = count; + } + + /// + /// Initializes a new instance of the class. + /// + public RebalanceCancelOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceIn.Json.g.cs new file mode 100644 index 00000000..37065047 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceIn), + jsonSerializerContext) as global::DeepInfra.RebalanceIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceIn.g.cs new file mode 100644 index 00000000..67921f8f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceIn.g.cs @@ -0,0 +1,72 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RebalanceIn + { + /// + /// Deployment to grow using GPUs freed from this one. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target_deploy_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string TargetDeployId { get; set; } + + /// + /// Number of target instances to create. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Count { get; set; } + + /// + /// Validate and preview without moving anything.
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("dry_run")] + public bool? DryRun { 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. + /// + /// + /// Deployment to grow using GPUs freed from this one. + /// + /// + /// Number of target instances to create. + /// + /// + /// Validate and preview without moving anything.
+ /// Default Value: false + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RebalanceIn( + string targetDeployId, + int count, + bool? dryRun) + { + this.TargetDeployId = targetDeployId ?? throw new global::System.ArgumentNullException(nameof(targetDeployId)); + this.Count = count; + this.DryRun = dryRun; + } + + /// + /// Initializes a new instance of the class. + /// + public RebalanceIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceOut.Json.g.cs new file mode 100644 index 00000000..f151864d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceOut), + jsonSerializerContext) as global::DeepInfra.RebalanceOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceOut.g.cs new file mode 100644 index 00000000..291ce334 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceOut.g.cs @@ -0,0 +1,106 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RebalanceOut + { + /// + /// Id of the started rebalance; empty on a dry run. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("replace_id")] + public string? ReplaceId { get; set; } + + /// + /// GPU type being rebalanced. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Gpu { get; set; } + + /// + /// Source instances now. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source_instances")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int SourceInstances { get; set; } + + /// + /// Source instances once the rebalance completes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source_instances_after")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int SourceInstancesAfter { get; set; } + + /// + /// Target instances now. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target_instances")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TargetInstances { get; set; } + + /// + /// Target instances once the rebalance completes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target_instances_after")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TargetInstancesAfter { 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. + /// + /// + /// GPU type being rebalanced. + /// + /// + /// Source instances now. + /// + /// + /// Source instances once the rebalance completes. + /// + /// + /// Target instances now. + /// + /// + /// Target instances once the rebalance completes. + /// + /// + /// Id of the started rebalance; empty on a dry run. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RebalanceOut( + string gpu, + int sourceInstances, + int sourceInstancesAfter, + int targetInstances, + int targetInstancesAfter, + string? replaceId) + { + this.ReplaceId = replaceId; + this.Gpu = gpu ?? throw new global::System.ArgumentNullException(nameof(gpu)); + this.SourceInstances = sourceInstances; + this.SourceInstancesAfter = sourceInstancesAfter; + this.TargetInstances = targetInstances; + this.TargetInstancesAfter = targetInstancesAfter; + } + + /// + /// Initializes a new instance of the class. + /// + public RebalanceOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatus.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatus.Json.g.cs new file mode 100644 index 00000000..d2b53e7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatus.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceStatus + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceStatus? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceStatus), + jsonSerializerContext) as global::DeepInfra.RebalanceStatus; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceStatus? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceStatus? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceStatus), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceStatus; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatus.g.cs new file mode 100644 index 00000000..e05b1ded --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatus.g.cs @@ -0,0 +1,173 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RebalanceStatus + { + /// + /// Id of the rebalance. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("replace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ReplaceId { get; set; } + + /// + /// Whether this deployment is the source or the target. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("direction")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.RebalanceStatusDirectionJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.RebalanceStatusDirection Direction { get; set; } + + /// + /// Rebalance status. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Status { get; set; } + + /// + /// Target instances delivered so far. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("placed")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Placed { get; set; } + + /// + /// Target instances requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Count { get; set; } + + /// + /// Deploy Id of the source; empty if not yours. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source_deploy_id")] + public string? SourceDeployId { get; set; } + + /// + /// Deploy Id of the target; empty if not yours. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target_deploy_id")] + public string? TargetDeployId { get; set; } + + /// + /// Model name of the source; empty if not yours. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("source_model_name")] + public string? SourceModelName { get; set; } + + /// + /// Model name of the target; empty if not yours. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("target_model_name")] + public string? TargetModelName { get; set; } + + /// + /// Failure reason, if any. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public string? Error { get; set; } + + /// + /// When the rebalance was requested. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + public string? CreatedAt { get; set; } + + /// + /// When the rebalance finished. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("finished_at")] + public string? FinishedAt { 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. + /// + /// + /// Id of the rebalance. + /// + /// + /// Whether this deployment is the source or the target. + /// + /// + /// Rebalance status. + /// + /// + /// Target instances delivered so far. + /// + /// + /// Target instances requested. + /// + /// + /// Deploy Id of the source; empty if not yours. + /// + /// + /// Deploy Id of the target; empty if not yours. + /// + /// + /// Model name of the source; empty if not yours. + /// + /// + /// Model name of the target; empty if not yours. + /// + /// + /// Failure reason, if any. + /// + /// + /// When the rebalance was requested. + /// + /// + /// When the rebalance finished. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RebalanceStatus( + string replaceId, + global::DeepInfra.RebalanceStatusDirection direction, + string status, + int placed, + int count, + string? sourceDeployId, + string? targetDeployId, + string? sourceModelName, + string? targetModelName, + string? error, + string? createdAt, + string? finishedAt) + { + this.ReplaceId = replaceId ?? throw new global::System.ArgumentNullException(nameof(replaceId)); + this.Direction = direction; + this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); + this.Placed = placed; + this.Count = count; + this.SourceDeployId = sourceDeployId; + this.TargetDeployId = targetDeployId; + this.SourceModelName = sourceModelName; + this.TargetModelName = targetModelName; + this.Error = error; + this.CreatedAt = createdAt; + this.FinishedAt = finishedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public RebalanceStatus() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusDirection.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusDirection.g.cs new file mode 100644 index 00000000..d44a7ed9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusDirection.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Whether this deployment is the source or the target. + /// + public enum RebalanceStatusDirection + { + /// + /// + /// + Incoming, + /// + /// + /// + Outgoing, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class RebalanceStatusDirectionExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this RebalanceStatusDirection value) + { + return value switch + { + RebalanceStatusDirection.Incoming => "incoming", + RebalanceStatusDirection.Outgoing => "outgoing", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static RebalanceStatusDirection? ToEnum(string value) + { + return value switch + { + "incoming" => RebalanceStatusDirection.Incoming, + "outgoing" => RebalanceStatusDirection.Outgoing, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOut.Json.g.cs new file mode 100644 index 00000000..a3b38398 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceStatusOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceStatusOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceStatusOut), + jsonSerializerContext) as global::DeepInfra.RebalanceStatusOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceStatusOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceStatusOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceStatusOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceStatusOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOut.g.cs new file mode 100644 index 00000000..ac850831 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOut.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RebalanceStatusOut + { + /// + /// The in-flight rebalance touching this deployment. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("active")] + public global::DeepInfra.RebalanceStatus? Active { get; set; } + + /// + /// Finished rebalances, newest first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("recent")] + public global::System.Collections.Generic.IList? Recent { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The in-flight rebalance touching this deployment. + /// + /// + /// Finished rebalances, newest first. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public RebalanceStatusOut( + global::DeepInfra.RebalanceStatus? active, + global::System.Collections.Generic.IList? recent) + { + this.Active = active; + this.Recent = recent; + } + + /// + /// Initializes a new instance of the class. + /// + public RebalanceStatusOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOutActive.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOutActive.Json.g.cs new file mode 100644 index 00000000..fa51a911 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOutActive.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RebalanceStatusOutActive + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceStatusOutActive? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RebalanceStatusOutActive), + jsonSerializerContext) as global::DeepInfra.RebalanceStatusOutActive; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RebalanceStatusOutActive? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RebalanceStatusOutActive? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RebalanceStatusOutActive), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RebalanceStatusOutActive; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOutActive.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOutActive.g.cs new file mode 100644 index 00000000..90d9b046 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RebalanceStatusOutActive.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The in-flight rebalance touching this deployment. + /// + public sealed partial class RebalanceStatusOutActive + { + + /// + /// 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.RegexResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.Json.g.cs index 7604c5d1..b1df2882 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RegexResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RegexResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RegexResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs index 8e3d811c..2491bdf4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RegexResponseFormat { @@ -53,5 +53,6 @@ public RegexResponseFormat( public RegexResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.Json.g.cs deleted file mode 100644 index 334f0b76..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey - { - /// - /// 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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey; - } - - /// - /// 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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey? 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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey; - } - - /// - /// 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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs deleted file mode 100644 index 65445f30..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey - { - - /// - /// 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.RequestCostItem.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.Json.g.cs index 547def85..5f17c357 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestCostItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestCostItem? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestCostItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs index 3a025e0a..1670c931 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RequestCostItem { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("requestId")] [global::System.Text.Json.Serialization.JsonRequired] public required string RequestId { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("costNanoUsd")] [global::System.Text.Json.Serialization.JsonRequired] @@ -50,5 +50,6 @@ public RequestCostItem( public RequestCostItem() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.Json.g.cs index b6093e15..f12a7afc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestCostQuery; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestCostQuery? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestCostQuery; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs index e0ea7418..056e2e0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RequestCostQuery { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("requestIds")] [global::System.Text.Json.Serialization.JsonRequired] @@ -40,5 +40,6 @@ public RequestCostQuery( public RequestCostQuery() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.Json.g.cs index fadece5d..07e4eac6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestCostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestCostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestCostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs index d16e2d55..1367e6ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RequestCostResponse { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("requests")] [global::System.Text.Json.Serialization.JsonRequired] @@ -40,5 +40,6 @@ public RequestCostResponse( public RequestCostResponse() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs deleted file mode 100644 index 63f59672..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse - { - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse), - jsonSerializerContext) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse; - } - - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse? 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse; - } - - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs deleted file mode 100644 index 87516280..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse - { - - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.Json.g.cs deleted file mode 100644 index 669784ee..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey - { - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey; - } - - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey? 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey; - } - - /// - /// 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs deleted file mode 100644 index 1ed09012..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey - { - - /// - /// 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.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse.Json.g.cs new file mode 100644 index 00000000..03e35888 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse), + jsonSerializerContext) as global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse.g.cs new file mode 100644 index 00000000..e0fdab15 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RequestGpuPoolChangeV1MeGpuPoolRequestPostResponse + { + + /// + /// 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.Json.g.cs index 91e1ebbe..5451c589 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs index fa274c8e..21053261 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.Json.g.cs deleted file mode 100644 index 55d0a144..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey - { - /// - /// 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey; - } - - /// - /// 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey? 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey; - } - - /// - /// 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs deleted file mode 100644 index 3d935710..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey - { - - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.Json.g.cs deleted file mode 100644 index 69476fe1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetResponse - { - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse; - } - - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse? 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.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse; - } - - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs deleted file mode 100644 index 8fb23d7a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetResponse - { - - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.Json.g.cs deleted file mode 100644 index 1c2ef2ee..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey - { - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey; - } - - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey? 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey; - } - - /// - /// 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs deleted file mode 100644 index 21a1d5b3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey - { - - /// - /// 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.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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.Json.g.cs index 34b5fb1e..6124df4c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs index 40e3efa0..5be6ddcb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class RetrieveOpenaiBatchesV1BatchesGetResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.Json.g.cs deleted file mode 100644 index 2ef2efb3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchesV1BatchesGetXiApiKey - { - /// - /// 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.RetrieveOpenaiBatchesV1BatchesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXiApiKey; - } - - /// - /// 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.RetrieveOpenaiBatchesV1BatchesGetXiApiKey? 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.RetrieveOpenaiBatchesV1BatchesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXiApiKey; - } - - /// - /// 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.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs deleted file mode 100644 index bcb3d796..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchesV1BatchesGetXiApiKey - { - - /// - /// 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.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.SandboxCreateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateIn.Json.g.cs new file mode 100644 index 00000000..7e38b9fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxCreateIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxCreateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxCreateIn), + jsonSerializerContext) as global::DeepInfra.SandboxCreateIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxCreateIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxCreateIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxCreateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxCreateIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateIn.g.cs new file mode 100644 index 00000000..8f2e6813 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateIn.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxCreateIn + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("plan")] + public string? Plan { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tags")] + public global::System.Collections.Generic.Dictionary? Tags { get; set; } + + /// + /// Default Value: 0 + /// + [global::System.Text.Json.Serialization.JsonPropertyName("timeout_seconds")] + public int? TimeoutSeconds { 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: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SandboxCreateIn( + string? plan, + global::System.Collections.Generic.Dictionary? tags, + int? timeoutSeconds) + { + this.Plan = plan; + this.Tags = tags; + this.TimeoutSeconds = timeoutSeconds; + } + + /// + /// Initializes a new instance of the class. + /// + public SandboxCreateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateInTags.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateInTags.Json.g.cs new file mode 100644 index 00000000..2b5eddc1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateInTags.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxCreateInTags + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxCreateInTags? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxCreateInTags), + jsonSerializerContext) as global::DeepInfra.SandboxCreateInTags; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxCreateInTags? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxCreateInTags? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxCreateInTags), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxCreateInTags; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateInTags.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateInTags.g.cs new file mode 100644 index 00000000..a742536f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateInTags.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxCreateInTags + { + + /// + /// 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.SandboxCreateOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateOut.Json.g.cs new file mode 100644 index 00000000..91184cc4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxCreateOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxCreateOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxCreateOut), + jsonSerializerContext) as global::DeepInfra.SandboxCreateOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxCreateOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxCreateOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxCreateOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxCreateOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateOut.g.cs new file mode 100644 index 00000000..219273c9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxCreateOut.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxCreateOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sandbox_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SandboxId { 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 SandboxCreateOut( + string sandboxId) + { + this.SandboxId = sandboxId ?? throw new global::System.ArgumentNullException(nameof(sandboxId)); + } + + /// + /// Initializes a new instance of the class. + /// + public SandboxCreateOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxDeleteV1SandboxesSandboxIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxDeleteV1SandboxesSandboxIdDeleteResponse.Json.g.cs new file mode 100644 index 00000000..9acd4bae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxDeleteV1SandboxesSandboxIdDeleteResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxDeleteV1SandboxesSandboxIdDeleteResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse), + jsonSerializerContext) as global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxDeleteV1SandboxesSandboxIdDeleteResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxDeleteV1SandboxesSandboxIdDeleteResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxDeleteV1SandboxesSandboxIdDeleteResponse.g.cs new file mode 100644 index 00000000..d1803001 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxDeleteV1SandboxesSandboxIdDeleteResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxDeleteV1SandboxesSandboxIdDeleteResponse + { + + /// + /// 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.SandboxExecIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecIn.Json.g.cs new file mode 100644 index 00000000..dc1f767b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxExecIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxExecIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxExecIn), + jsonSerializerContext) as global::DeepInfra.SandboxExecIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxExecIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxExecIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxExecIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxExecIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecIn.g.cs new file mode 100644 index 00000000..92e06ee9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecIn.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxExecIn + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("command")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Command { get; set; } + + /// + /// Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("timeout_seconds")] + public int? TimeoutSeconds { 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. + /// + /// + /// + /// Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).
+ /// Default Value: 0 + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SandboxExecIn( + global::System.Collections.Generic.IList command, + int? timeoutSeconds) + { + this.Command = command ?? throw new global::System.ArgumentNullException(nameof(command)); + this.TimeoutSeconds = timeoutSeconds; + } + + /// + /// Initializes a new instance of the class. + /// + public SandboxExecIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecV1SandboxesSandboxIdExecPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecV1SandboxesSandboxIdExecPostResponse.Json.g.cs new file mode 100644 index 00000000..1bd81171 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecV1SandboxesSandboxIdExecPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxExecV1SandboxesSandboxIdExecPostResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse), + jsonSerializerContext) as global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxExecV1SandboxesSandboxIdExecPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecV1SandboxesSandboxIdExecPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecV1SandboxesSandboxIdExecPostResponse.g.cs new file mode 100644 index 00000000..e9afdb6d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxExecV1SandboxesSandboxIdExecPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxExecV1SandboxesSandboxIdExecPostResponse + { + + /// + /// 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.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse.Json.g.cs new file mode 100644 index 00000000..9e62e1df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse), + jsonSerializerContext) as global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse.g.cs new file mode 100644 index 00000000..fddb9ef5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxFsReadV1SandboxesSandboxIdFsContentGetResponse + { + + /// + /// 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.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse.Json.g.cs new file mode 100644 index 00000000..4b941b3d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse), + jsonSerializerContext) as global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse.g.cs new file mode 100644 index 00000000..d4db4122 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxFsWriteV1SandboxesSandboxIdFsContentPutResponse + { + + /// + /// 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.SandboxOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOut.Json.g.cs new file mode 100644 index 00000000..0cef3232 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxOut), + jsonSerializerContext) as global::DeepInfra.SandboxOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOut.g.cs new file mode 100644 index 00000000..4e929968 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOut.g.cs @@ -0,0 +1,114 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sandbox_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SandboxId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("plan")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Plan { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Image { 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("tags")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.Dictionary Tags { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("provider")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Provider { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("fail_reason")] + public string? FailReason { 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 SandboxOut( + string sandboxId, + string plan, + string image, + string state, + global::System.Collections.Generic.Dictionary tags, + int createdAt, + string provider, + string? failReason) + { + this.SandboxId = sandboxId ?? throw new global::System.ArgumentNullException(nameof(sandboxId)); + this.Plan = plan ?? throw new global::System.ArgumentNullException(nameof(plan)); + this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); + this.State = state ?? throw new global::System.ArgumentNullException(nameof(state)); + this.Tags = tags ?? throw new global::System.ArgumentNullException(nameof(tags)); + this.CreatedAt = createdAt; + this.Provider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + this.FailReason = failReason; + } + + /// + /// Initializes a new instance of the class. + /// + public SandboxOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOutTags.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOutTags.Json.g.cs new file mode 100644 index 00000000..75e4a1c3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOutTags.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxOutTags + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxOutTags? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxOutTags), + jsonSerializerContext) as global::DeepInfra.SandboxOutTags; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxOutTags? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxOutTags? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxOutTags), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxOutTags; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOutTags.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOutTags.g.cs new file mode 100644 index 00000000..e04d4aa3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxOutTags.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxOutTags + { + + /// + /// 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.SandboxPlanOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxPlanOut.Json.g.cs new file mode 100644 index 00000000..fbaad19f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxPlanOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxPlanOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxPlanOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxPlanOut), + jsonSerializerContext) as global::DeepInfra.SandboxPlanOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxPlanOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxPlanOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxPlanOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxPlanOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxPlanOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxPlanOut.g.cs new file mode 100644 index 00000000..45f3293a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxPlanOut.g.cs @@ -0,0 +1,85 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxPlanOut + { + /// + /// + /// + [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("vcpu")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Vcpu { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ram_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int RamGb { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("disk_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int DiskGb { get; set; } + + /// + /// + /// + [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. + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SandboxPlanOut( + string id, + int vcpu, + int ramGb, + int diskGb, + double pricePerHour) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Vcpu = vcpu; + this.RamGb = ramGb; + this.DiskGb = diskGb; + this.PricePerHour = pricePerHour; + } + + /// + /// Initializes a new instance of the class. + /// + public SandboxPlanOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStartV1SandboxesSandboxIdStartPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStartV1SandboxesSandboxIdStartPostResponse.Json.g.cs new file mode 100644 index 00000000..095eaa88 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStartV1SandboxesSandboxIdStartPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxStartV1SandboxesSandboxIdStartPostResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse), + jsonSerializerContext) as global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxStartV1SandboxesSandboxIdStartPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStartV1SandboxesSandboxIdStartPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStartV1SandboxesSandboxIdStartPostResponse.g.cs new file mode 100644 index 00000000..3fa3a0d6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStartV1SandboxesSandboxIdStartPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxStartV1SandboxesSandboxIdStartPostResponse + { + + /// + /// 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.SandboxStopV1SandboxesSandboxIdStopPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStopV1SandboxesSandboxIdStopPostResponse.Json.g.cs new file mode 100644 index 00000000..78e0d658 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStopV1SandboxesSandboxIdStopPostResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SandboxStopV1SandboxesSandboxIdStopPostResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse), + jsonSerializerContext) as global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SandboxStopV1SandboxesSandboxIdStopPostResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStopV1SandboxesSandboxIdStopPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStopV1SandboxesSandboxIdStopPostResponse.g.cs new file mode 100644 index 00000000..bdda2390 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SandboxStopV1SandboxesSandboxIdStopPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SandboxStopV1SandboxesSandboxIdStopPostResponse + { + + /// + /// 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.Json.g.cs index 52c126b9..b64c060c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScaleSettings; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScaleSettings? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScaleSettings; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs index 028dca76..7584a06d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ScaleSettings { @@ -56,5 +56,6 @@ public ScaleSettings( public ScaleSettings() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.Json.g.cs index 87a82b21..3b5e0d6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs index 532fbd0c..d3dac1f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs @@ -4,37 +4,37 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("variant")] [global::System.Text.Json.Serialization.JsonRequired] public required global::DeepInfra.SchemaVariant Variant { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("schema_in")] public object? SchemaIn { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("schema_out")] public object? SchemaOut1 { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("schema_stream")] public object? SchemaStream { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("fields_in")] [global::System.Text.Json.Serialization.JsonRequired] @@ -77,5 +77,6 @@ public SchemaOut( public SchemaOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.Json.g.cs index 4e0b2f2f..313ca4ec 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOutSchemaIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOutSchemaIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOutSchemaIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs index 1d36cd3c..4aa9c230 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOutSchemaIn { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.Json.g.cs index a1308ee0..e2bc70fb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOutSchemaIn2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOutSchemaIn2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOutSchemaIn2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs index 9b73b6dd..028f5ad9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOutSchemaIn2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.Json.g.cs index c8067464..ff6a9978 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOutSchemaOut1; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOutSchemaOut1? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOutSchemaOut1; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs index aebbed26..34f9f823 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOutSchemaOut1 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.Json.g.cs index 0a194cfd..3e34b433 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOutSchemaOut12; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOutSchemaOut12? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOutSchemaOut12; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs index eb7f1625..128b58ab 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOutSchemaOut12 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.Json.g.cs index a62758b0..1681fece 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOutSchemaStream; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOutSchemaStream? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOutSchemaStream; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs index 77b289cf..0d86c092 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOutSchemaStream { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.Json.g.cs index 27a4b554..4ff679e7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaOutSchemaStream2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaOutSchemaStream2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaOutSchemaStream2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs index 1a767f37..fcce2f61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaOutSchemaStream2 { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.Json.g.cs index c8087dac..bfeee5cf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SchemaVariant; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SchemaVariant? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SchemaVariant; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs index 5865eb90..8e465e9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SchemaVariant { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("key")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.SchemaVariantKeyJsonConverter))] @@ -17,7 +17,7 @@ public sealed partial class SchemaVariant public required global::DeepInfra.SchemaVariantKey Key { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("url")] [global::System.Text.Json.Serialization.JsonRequired] @@ -51,5 +51,6 @@ public SchemaVariant( public SchemaVariant() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariantKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariantKey.g.cs index 9963568d..344604e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariantKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariantKey.g.cs @@ -4,72 +4,72 @@ namespace DeepInfra { /// - /// + /// /// public enum SchemaVariantKey { /// - /// + /// /// AiSdk, /// - /// + /// /// CreateVoice, /// - /// + /// /// Default, /// - /// + /// /// DeleteVoice, /// - /// + /// /// ElevenlabsTts, /// - /// + /// /// ListVoices, /// - /// + /// /// OpenaiChatCompletions, /// - /// + /// /// OpenaiCompletions, /// - /// + /// /// OpenaiEmbeddings, /// - /// + /// /// OpenaiImages, /// - /// + /// /// OpenaiImagesEdits, /// - /// + /// /// OpenaiImagesVariations, /// - /// + /// /// OpenaiSpeechToText, /// - /// + /// /// OpenaiTts, /// - /// + /// /// ReadVoice, /// - /// + /// /// UpdateVoice, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.Json.g.cs index 8e6c05e4..7101fddd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScopedJWTIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScopedJWTIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs index 72b4a486..e2b3fade 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ScopedJWTIn { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("api_key_name")] [global::System.Text.Json.Serialization.JsonRequired] @@ -84,5 +84,6 @@ public ScopedJWTIn( public ScopedJWTIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs deleted file mode 100644 index 8aabf8c0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ScopedJWTInExpiresAt - { - /// - /// 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.ScopedJWTInExpiresAt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ScopedJWTInExpiresAt), - jsonSerializerContext) as global::DeepInfra.ScopedJWTInExpiresAt; - } - - /// - /// 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.ScopedJWTInExpiresAt? 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.ScopedJWTInExpiresAt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInExpiresAt; - } - - /// - /// 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.ScopedJWTInExpiresAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs deleted file mode 100644 index acf80118..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// unix timestamp when the token should expire - /// - public sealed partial class ScopedJWTInExpiresAt - { - - /// - /// 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.ScopedJWTInExpiresDelta.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.Json.g.cs deleted file mode 100644 index 06c781e1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ScopedJWTInExpiresDelta - { - /// - /// 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.ScopedJWTInExpiresDelta? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ScopedJWTInExpiresDelta), - jsonSerializerContext) as global::DeepInfra.ScopedJWTInExpiresDelta; - } - - /// - /// 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.ScopedJWTInExpiresDelta? 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.ScopedJWTInExpiresDelta), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInExpiresDelta; - } - - /// - /// 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.ScopedJWTInExpiresDelta.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs deleted file mode 100644 index 6c5861df..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// how many seconds in the future should the token be valid for - /// - public sealed partial class ScopedJWTInExpiresDelta - { - - /// - /// 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.ScopedJWTInModels.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.Json.g.cs deleted file mode 100644 index 2cbc0a1b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ScopedJWTInModels - { - /// - /// 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.ScopedJWTInModels? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ScopedJWTInModels), - jsonSerializerContext) as global::DeepInfra.ScopedJWTInModels; - } - - /// - /// 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.ScopedJWTInModels? 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.ScopedJWTInModels), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInModels; - } - - /// - /// 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.ScopedJWTInModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs deleted file mode 100644 index d717dceb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// allow inference only to the specified model names - /// - public sealed partial class ScopedJWTInModels - { - - /// - /// 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.ScopedJWTInSpendingLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.Json.g.cs deleted file mode 100644 index 94d10be9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ScopedJWTInSpendingLimit - { - /// - /// 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.ScopedJWTInSpendingLimit? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ScopedJWTInSpendingLimit), - jsonSerializerContext) as global::DeepInfra.ScopedJWTInSpendingLimit; - } - - /// - /// 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.ScopedJWTInSpendingLimit? 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.ScopedJWTInSpendingLimit), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInSpendingLimit; - } - - /// - /// 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.ScopedJWTInSpendingLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs deleted file mode 100644 index b7897cdc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// only allow spending that much USD until the token becomes invalid - /// - public sealed partial class ScopedJWTInSpendingLimit - { - - /// - /// 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.ScopedJWTOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.Json.g.cs index d8e41a77..59d02a12 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScopedJWTOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScopedJWTOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs index ad63c4e2..08615e71 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ScopedJWTOut { @@ -42,5 +42,6 @@ public ScopedJWTOut( public ScopedJWTOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ServiceTier.g.cs index 567a9da0..585bc38c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ServiceTier.g.cs @@ -4,16 +4,20 @@ namespace DeepInfra { /// - /// + /// /// public enum ServiceTier { /// - /// + /// /// Default, /// - /// + /// + /// + Flex, + /// + /// /// Priority, } @@ -31,6 +35,7 @@ public static string ToValueString(this ServiceTier value) return value switch { ServiceTier.Default => "default", + ServiceTier.Flex => "flex", ServiceTier.Priority => "priority", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; @@ -43,6 +48,7 @@ public static string ToValueString(this ServiceTier value) return value switch { "default" => ServiceTier.Default, + "flex" => ServiceTier.Flex, "priority" => ServiceTier.Priority, _ => null, }; diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.Json.g.cs index 2e809ed5..f928a2c9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SetConfigPaymentConfigPostSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SetConfigPaymentConfigPostSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SetConfigPaymentConfigPostSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs index 37e2996e..96eac308 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SetConfigPaymentConfigPostSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.Json.g.cs index 13621337..43a8aa2b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SetupTopupPaymentTopupPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SetupTopupPaymentTopupPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SetupTopupPaymentTopupPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs index 7a8209ec..89540787 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SetupTopupPaymentTopupPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.Json.g.cs index 1ba5b4d5..d76d66ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SetupTopupPaymentTopupPostSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SetupTopupPaymentTopupPostSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SetupTopupPaymentTopupPostSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs index aa97e345..52bc89a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SetupTopupPaymentTopupPostSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.Json.g.cs index 010336e0..49b80f88 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SourceModel; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SourceModel? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SourceModel; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs index 96f0048d..c3faa94d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs @@ -4,19 +4,19 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SourceModel { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.SourceTypeEnumJsonConverter))] public global::DeepInfra.SourceTypeEnum Type { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("civit_url")] public string? CivitUrl { get; set; } @@ -49,5 +49,6 @@ public SourceModel( public SourceModel() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs deleted file mode 100644 index e32dc64b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class SourceModelCivitUrl - { - /// - /// 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.SourceModelCivitUrl? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.SourceModelCivitUrl), - jsonSerializerContext) as global::DeepInfra.SourceModelCivitUrl; - } - - /// - /// 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.SourceModelCivitUrl? 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.SourceModelCivitUrl), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SourceModelCivitUrl; - } - - /// - /// 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.SourceModelCivitUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs deleted file mode 100644 index 374e53a6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class SourceModelCivitUrl - { - - /// - /// 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.SourceTypeEnum.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceTypeEnum.g.cs index 55ef0594..1ed48b2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceTypeEnum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceTypeEnum.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public enum SourceTypeEnum { /// - /// + /// /// Civitai, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.Json.g.cs index 9ca3b2dd..3e0eefc6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SshKeyIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SshKeyIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SshKeyIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs index 1d8f6189..4e24a624 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SshKeyIn { @@ -54,5 +54,6 @@ public SshKeyIn( public SshKeyIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.Json.g.cs index 90ba4afa..fc7ab180 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SshKeyOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SshKeyOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SshKeyOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs index 13cc4f4d..516a7777 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SshKeyOut { @@ -30,7 +30,7 @@ public sealed partial class SshKeyOut public required string Key { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] public int? CreatedAt { get; set; } @@ -75,5 +75,6 @@ public SshKeyOut( public SshKeyOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgs.Json.g.cs new file mode 100644 index 00000000..ca8296da --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgs), + jsonSerializerContext) as global::DeepInfra.StandardArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.StandardArgs? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.StandardArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgs.g.cs new file mode 100644 index 00000000..48d94d1d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgs.g.cs @@ -0,0 +1,113 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The standard-argument allowlist. Construct from a raw ``dict[str, str]``
+ /// via :meth:`from_raw`; render to engine flags via :func:`standard_parts`. + ///
+ public sealed partial class StandardArgs + { + /// + /// Maximum total sequence length (prompt + generation). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_context_size")] + public int? MaxContextSize { get; set; } + + /// + /// Max number of requests served concurrently. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_concurrent_requests")] + public int? MaxConcurrentRequests { get; set; } + + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("gpu_memory_fraction")] + public double? GpuMemoryFraction { get; set; } + + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_prefill_tokens")] + public int? MaxPrefillTokens { get; set; } + + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("kv_cache_dtype")] + public global::DeepInfra.StandardArgsKvCacheDtype2? KvCacheDtype { get; set; } + + /// + /// Reuse KV cache for shared prompt prefixes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("enable_prefix_caching")] + public bool? EnablePrefixCaching { get; set; } + + /// + /// On-the-fly weight quantization method. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("quantization")] + public global::DeepInfra.StandardArgsQuantization2? Quantization { 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. + /// + /// + /// Maximum total sequence length (prompt + generation). + /// + /// + /// Max number of requests served concurrently. + /// + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + /// + /// Reuse KV cache for shared prompt prefixes. + /// + /// + /// On-the-fly weight quantization method. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public StandardArgs( + int? maxContextSize, + int? maxConcurrentRequests, + double? gpuMemoryFraction, + int? maxPrefillTokens, + global::DeepInfra.StandardArgsKvCacheDtype2? kvCacheDtype, + bool? enablePrefixCaching, + global::DeepInfra.StandardArgsQuantization2? quantization) + { + this.MaxContextSize = maxContextSize; + this.MaxConcurrentRequests = maxConcurrentRequests; + this.GpuMemoryFraction = gpuMemoryFraction; + this.MaxPrefillTokens = maxPrefillTokens; + this.KvCacheDtype = kvCacheDtype; + this.EnablePrefixCaching = enablePrefixCaching; + this.Quantization = quantization; + } + + /// + /// Initializes a new instance of the class. + /// + public StandardArgs() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype.g.cs new file mode 100644 index 00000000..d4676974 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss. + /// + public sealed partial class StandardArgsKvCacheDtype + { + + /// + /// 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.StandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..f89ffa70 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype2.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum StandardArgsKvCacheDtype2 + { + /// + /// + /// + Auto, + /// + /// + /// + Fp8, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class StandardArgsKvCacheDtype2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this StandardArgsKvCacheDtype2 value) + { + return value switch + { + StandardArgsKvCacheDtype2.Auto => "auto", + StandardArgsKvCacheDtype2.Fp8 => "fp8", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static StandardArgsKvCacheDtype2? ToEnum(string value) + { + return value switch + { + "auto" => StandardArgsKvCacheDtype2.Auto, + "fp8" => StandardArgsKvCacheDtype2.Fp8, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization.g.cs new file mode 100644 index 00000000..88274b20 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// On-the-fly weight quantization method. + /// + public sealed partial class StandardArgsQuantization + { + + /// + /// 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.StandardArgsQuantization2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization2.g.cs new file mode 100644 index 00000000..c3cd5c97 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization2.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum StandardArgsQuantization2 + { + /// + /// + /// + Awq, + /// + /// + /// + AwqMarlin, + /// + /// + /// + Bitsandbytes, + /// + /// + /// + CompressedTensors, + /// + /// + /// + Fp8, + /// + /// + /// + Gptq, + /// + /// + /// + GptqMarlin, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class StandardArgsQuantization2Extensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this StandardArgsQuantization2 value) + { + return value switch + { + StandardArgsQuantization2.Awq => "awq", + StandardArgsQuantization2.AwqMarlin => "awq_marlin", + StandardArgsQuantization2.Bitsandbytes => "bitsandbytes", + StandardArgsQuantization2.CompressedTensors => "compressed-tensors", + StandardArgsQuantization2.Fp8 => "fp8", + StandardArgsQuantization2.Gptq => "gptq", + StandardArgsQuantization2.GptqMarlin => "gptq_marlin", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static StandardArgsQuantization2? ToEnum(string value) + { + return value switch + { + "awq" => StandardArgsQuantization2.Awq, + "awq_marlin" => StandardArgsQuantization2.AwqMarlin, + "bitsandbytes" => StandardArgsQuantization2.Bitsandbytes, + "compressed-tensors" => StandardArgsQuantization2.CompressedTensors, + "fp8" => StandardArgsQuantization2.Fp8, + "gptq" => StandardArgsQuantization2.Gptq, + "gptq_marlin" => StandardArgsQuantization2.GptqMarlin, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.Json.g.cs index 91a4d7f5..bcc462e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.StreamOptions; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StreamOptions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StreamOptions; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs index 02c5bac9..ff467bc8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class StreamOptions { @@ -56,5 +56,6 @@ public StreamOptions( public StreamOptions() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.Json.g.cs index fb52d523..7a9325ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SubmitFeedbackV1FeedbackPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SubmitFeedbackV1FeedbackPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SubmitFeedbackV1FeedbackPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs index aee490c0..f3c1f920 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class SubmitFeedbackV1FeedbackPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.Json.g.cs deleted file mode 100644 index 1cb75703..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class SubmitFeedbackV1FeedbackPostXiApiKey - { - /// - /// 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.SubmitFeedbackV1FeedbackPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.SubmitFeedbackV1FeedbackPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.SubmitFeedbackV1FeedbackPostXiApiKey; - } - - /// - /// 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.SubmitFeedbackV1FeedbackPostXiApiKey? 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.SubmitFeedbackV1FeedbackPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SubmitFeedbackV1FeedbackPostXiApiKey; - } - - /// - /// 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.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs deleted file mode 100644 index fdb92fa3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class SubmitFeedbackV1FeedbackPostXiApiKey - { - - /// - /// 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.SuspendReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs index b70570ec..28743410 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs @@ -4,32 +4,36 @@ namespace DeepInfra { /// - /// + /// /// public enum SuspendReason { /// - /// + /// /// Admin, /// - /// + /// /// BadCc, /// - /// + /// /// Balance, /// - /// + /// /// LimitReached, /// - /// + /// + /// + MissingAddress, + /// + /// /// OverdueInvoices, /// - /// + /// /// PaymentMethod, } @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.Json.g.cs index 3b5f37c5..cd69f82d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs index 55453961..ce952e7f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.Json.g.cs deleted file mode 100644 index 588f3699..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey - { - /// - /// 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.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey), - jsonSerializerContext) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey; - } - - /// - /// 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.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey? 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.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey; - } - - /// - /// 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.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs deleted file mode 100644 index 66a559fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey - { - - /// - /// 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.TextResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.Json.g.cs index 1997bb09..e04e5c8b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs index 49fed3e7..25d35c8f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class TextResponseFormat { @@ -41,5 +41,6 @@ public TextResponseFormat( public TextResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs deleted file mode 100644 index 3f45b512..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat - { - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat), - jsonSerializerContext) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat; - } - - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat? 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat; - } - - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs deleted file mode 100644 index d8e4ef09..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat - { - - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.Json.g.cs index aae0bec2..c78eb0b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs index 44812c32..a4ba476b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.Json.g.cs deleted file mode 100644 index 51ece8c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey - { - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey; - } - - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey? 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey; - } - - /// - /// 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs deleted file mode 100644 index f8b8564f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey - { - - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs deleted file mode 100644 index 4a9549cf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat - { - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat), - jsonSerializerContext) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat; - } - - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat? 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.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat; - } - - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs deleted file mode 100644 index f8d1a844..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat - { - - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.Json.g.cs index 2809f9f6..e46da55e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs index 5ab8c72a..a3d7bcef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.Json.g.cs deleted file mode 100644 index 83acbe9b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey - { - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey; - } - - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey? 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.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey; - } - - /// - /// 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.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs deleted file mode 100644 index 845840f6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey - { - - /// - /// 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.TimeDeploymentStatsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.Json.g.cs index 90ee30f3..505e0597 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TimeDeploymentStatsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TimeDeploymentStatsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TimeDeploymentStatsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs index 7cc081f9..64b6b754 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class TimeDeploymentStatsOut { @@ -102,5 +102,6 @@ public TimeDeploymentStatsOut( public TimeDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.Json.g.cs index df866377..ef26e4a8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TimeInterval; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TimeInterval? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TimeInterval; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.TokenizeIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeIn.Json.g.cs new file mode 100644 index 00000000..f86382f8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeIn), + jsonSerializerContext) as global::DeepInfra.TokenizeIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.TokenizeIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.TokenizeIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeIn.g.cs new file mode 100644 index 00000000..cacbed12 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeIn.g.cs @@ -0,0 +1,80 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TokenizeIn + { + /// + /// model name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// text to tokenize (completion form) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] + public string? Prompt { get; set; } + + /// + /// chat messages to tokenize (chat form) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("messages")] + public global::System.Collections.Generic.IList? Messages { get; set; } + + /// + /// also return the per-token strings (vLLM) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("return_token_strs")] + public bool? ReturnTokenStrs { 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. + /// + /// + /// model name + /// + /// + /// text to tokenize (completion form) + /// + /// + /// chat messages to tokenize (chat form) + /// + /// + /// also return the per-token strings (vLLM) + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public TokenizeIn( + string model, + string? prompt, + global::System.Collections.Generic.IList? messages, + bool? returnTokenStrs) + { + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Prompt = prompt; + this.Messages = messages; + this.ReturnTokenStrs = returnTokenStrs; + } + + /// + /// Initializes a new instance of the class. + /// + public TokenizeIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessagesVariant1Item.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessagesVariant1Item.Json.g.cs new file mode 100644 index 00000000..3656db90 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessagesVariant1Item.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeInMessagesVariant1Item + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeInMessagesVariant1Item? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeInMessagesVariant1Item), + jsonSerializerContext) as global::DeepInfra.TokenizeInMessagesVariant1Item; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeInMessagesVariant1Item? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.TokenizeInMessagesVariant1Item? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.TokenizeInMessagesVariant1Item), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeInMessagesVariant1Item; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessagesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessagesVariant1Item.g.cs new file mode 100644 index 00000000..44e9a394 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessagesVariant1Item.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TokenizeInMessagesVariant1Item + { + + /// + /// 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.TokenizeOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOut.Json.g.cs new file mode 100644 index 00000000..97e50c49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeOut), + jsonSerializerContext) as global::DeepInfra.TokenizeOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.TokenizeOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.TokenizeOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOut.g.cs new file mode 100644 index 00000000..bd13b41a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOut.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TokenizeOut + { + /// + /// number of tokens + /// + [global::System.Text.Json.Serialization.JsonPropertyName("count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Count { get; set; } + + /// + /// the model's maximum context length + /// + [global::System.Text.Json.Serialization.JsonPropertyName("max_model_len")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int MaxModelLen { get; set; } + + /// + /// token ids + /// + [global::System.Text.Json.Serialization.JsonPropertyName("tokens")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Tokens { get; set; } + + /// + /// per-token strings, if requested (vLLM) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("token_strs")] + public global::System.Collections.Generic.IList? TokenStrs { 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. + /// + /// + /// number of tokens + /// + /// + /// the model's maximum context length + /// + /// + /// token ids + /// + /// + /// per-token strings, if requested (vLLM) + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public TokenizeOut( + int count, + int maxModelLen, + global::System.Collections.Generic.IList tokens, + global::System.Collections.Generic.IList? tokenStrs) + { + this.Count = count; + this.MaxModelLen = maxModelLen; + this.Tokens = tokens ?? throw new global::System.ArgumentNullException(nameof(tokens)); + this.TokenStrs = tokenStrs; + } + + /// + /// Initializes a new instance of the class. + /// + public TokenizeOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.Json.g.cs index 7b25e876..8d9c85d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TopUpIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TopUpIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TopUpIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs index b188f7e4..320d8eba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class TopUpIn { @@ -69,5 +69,6 @@ public TopUpIn( public TopUpIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TtsResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TtsResponseFormat.g.cs index 01615fec..3c1fe389 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TtsResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TtsResponseFormat.g.cs @@ -10,23 +10,23 @@ namespace DeepInfra public enum TtsResponseFormat { /// - /// + /// /// Flac, /// - /// + /// /// Mp3, /// - /// + /// /// Opus, /// - /// + /// /// Pcm, /// - /// + /// /// Wav, } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.Json.g.cs index b190d579..7212c217 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UpdateLoraApiRequest; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateLoraApiRequest? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraApiRequest; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs index a3af9c73..1ef9d0ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs @@ -4,18 +4,18 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UpdateLoraApiRequest { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("private")] public bool? Private { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("description")] public string? Description { get; set; } @@ -48,5 +48,6 @@ public UpdateLoraApiRequest( public UpdateLoraApiRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs deleted file mode 100644 index 63cdae00..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UpdateLoraApiRequestDescription - { - /// - /// 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.UpdateLoraApiRequestDescription? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UpdateLoraApiRequestDescription), - jsonSerializerContext) as global::DeepInfra.UpdateLoraApiRequestDescription; - } - - /// - /// 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.UpdateLoraApiRequestDescription? 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.UpdateLoraApiRequestDescription), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraApiRequestDescription; - } - - /// - /// 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.UpdateLoraApiRequestDescription.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs deleted file mode 100644 index 4e713b05..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class UpdateLoraApiRequestDescription - { - - /// - /// 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.UpdateLoraApiRequestPrivate.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.Json.g.cs deleted file mode 100644 index 0f96b6bc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UpdateLoraApiRequestPrivate - { - /// - /// 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.UpdateLoraApiRequestPrivate? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UpdateLoraApiRequestPrivate), - jsonSerializerContext) as global::DeepInfra.UpdateLoraApiRequestPrivate; - } - - /// - /// 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.UpdateLoraApiRequestPrivate? 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.UpdateLoraApiRequestPrivate), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraApiRequestPrivate; - } - - /// - /// 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.UpdateLoraApiRequestPrivate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs deleted file mode 100644 index c639c934..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class UpdateLoraApiRequestPrivate - { - - /// - /// 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.UpdateLoraV1LoraLoraNamePatchResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.Json.g.cs index 32a5449e..c07374a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateLoraV1LoraLoraNamePatchResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs index 8521774c..003e5d63 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UpdateLoraV1LoraLoraNamePatchResponse { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.Json.g.cs deleted file mode 100644 index 5ae297ad..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UpdateLoraV1LoraLoraNamePatchXiApiKey - { - /// - /// 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.UpdateLoraV1LoraLoraNamePatchXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXiApiKey), - jsonSerializerContext) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXiApiKey; - } - - /// - /// 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.UpdateLoraV1LoraLoraNamePatchXiApiKey? 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.UpdateLoraV1LoraLoraNamePatchXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXiApiKey; - } - - /// - /// 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.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs deleted file mode 100644 index 2a0a675d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class UpdateLoraV1LoraLoraNamePatchXiApiKey - { - - /// - /// 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.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.Json.g.cs deleted file mode 100644 index faa3bc3b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey - { - /// - /// 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.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey; - } - - /// - /// 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.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey? 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.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey; - } - - /// - /// 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.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs deleted file mode 100644 index c97affb1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey - { - - /// - /// 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.UploadLoraModelLoraModelPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.Json.g.cs deleted file mode 100644 index 4045f2de..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UploadLoraModelLoraModelPostXiApiKey - { - /// - /// 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.UploadLoraModelLoraModelPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UploadLoraModelLoraModelPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.UploadLoraModelLoraModelPostXiApiKey; - } - - /// - /// 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.UploadLoraModelLoraModelPostXiApiKey? 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.UploadLoraModelLoraModelPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UploadLoraModelLoraModelPostXiApiKey; - } - - /// - /// 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.UploadLoraModelLoraModelPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs deleted file mode 100644 index f0be8bca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class UploadLoraModelLoraModelPostXiApiKey - { - - /// - /// 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.UsageApiTokenPaymentUsageApiTokenGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.Json.g.cs index a1214b9d..3576b639 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs index daf72d09..a396f999 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageApiTokenPaymentUsageApiTokenGetSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs deleted file mode 100644 index ba99e853..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UsageApiTokenPaymentUsageApiTokenGetTo - { - /// - /// 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.UsageApiTokenPaymentUsageApiTokenGetTo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetTo), - jsonSerializerContext) as global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetTo; - } - - /// - /// 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.UsageApiTokenPaymentUsageApiTokenGetTo? 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.UsageApiTokenPaymentUsageApiTokenGetTo), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetTo; - } - - /// - /// 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.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs deleted file mode 100644 index 36dc98e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - public sealed partial class UsageApiTokenPaymentUsageApiTokenGetTo - { - - /// - /// 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.UsageItem.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.Json.g.cs index 7ac40349..fbcdc43e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageItem; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageItem? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageItem; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs index 8f79575d..6e48118c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageItem { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonRequired] @@ -111,5 +111,6 @@ public UsageItem( public UsageItem() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.Json.g.cs index 8af7a6e9..d2763774 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageItemDiscount; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageItemDiscount? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageItemDiscount; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.Json.g.cs index b0296dd9..90c84ec2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageMonth; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageMonth? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageMonth; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs index 6b34d7e2..03896343 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageMonth { @@ -23,7 +23,7 @@ public sealed partial class UsageMonth public required global::DeepInfra.TimeInterval Interval { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("items")] [global::System.Text.Json.Serialization.JsonRequired] @@ -89,5 +89,6 @@ public UsageMonth( public UsageMonth() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.Json.g.cs index ef63f1d1..662c9d0c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs index b713e4eb..4d9db37a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs @@ -4,12 +4,12 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageOut { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("months")] [global::System.Text.Json.Serialization.JsonRequired] @@ -52,5 +52,6 @@ public UsageOut( public UsageOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.Json.g.cs index 04c03f8a..9b814c30 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsagePaymentUsageGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsagePaymentUsageGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsagePaymentUsageGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs index 238a1356..b09a72e9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsagePaymentUsageGetSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs deleted file mode 100644 index bfb6d715..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UsagePaymentUsageGetTo - { - /// - /// 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.UsagePaymentUsageGetTo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UsagePaymentUsageGetTo), - jsonSerializerContext) as global::DeepInfra.UsagePaymentUsageGetTo; - } - - /// - /// 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.UsagePaymentUsageGetTo? 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.UsagePaymentUsageGetTo), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsagePaymentUsageGetTo; - } - - /// - /// 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.UsagePaymentUsageGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs deleted file mode 100644 index 7ef9f675..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - public sealed partial class UsagePaymentUsageGetTo - { - - /// - /// 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.UsageRentOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.Json.g.cs index 1ec0f074..ee0d2c18 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageRentOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageRentOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageRentOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs index f88797fb..bd7c5b5f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageRentOut { @@ -42,5 +42,6 @@ public UsageRentOut( public UsageRentOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.Json.g.cs index ff33bbd8..3acbed3e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageRentOutIdToDuration; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageRentOutIdToDuration? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageRentOutIdToDuration; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.Json.g.cs index 46c9a8ad..dd75f97a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageRentPaymentUsageRentGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageRentPaymentUsageRentGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageRentPaymentUsageRentGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs index 2ddd488f..7685f86a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageRentPaymentUsageRentGetSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs deleted file mode 100644 index 949c5971..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UsageRentPaymentUsageRentGetTo - { - /// - /// 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.UsageRentPaymentUsageRentGetTo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UsageRentPaymentUsageRentGetTo), - jsonSerializerContext) as global::DeepInfra.UsageRentPaymentUsageRentGetTo; - } - - /// - /// 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.UsageRentPaymentUsageRentGetTo? 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.UsageRentPaymentUsageRentGetTo), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageRentPaymentUsageRentGetTo; - } - - /// - /// 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.UsageRentPaymentUsageRentGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs deleted file mode 100644 index 32b3f35b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// end of period, in seconds since unix epoch - /// - public sealed partial class UsageRentPaymentUsageRentGetTo - { - - /// - /// 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.UsageTokensPaymentUsageTokensGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.Json.g.cs index 4988676f..1c93300e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageTokensPaymentUsageTokensGetSession; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageTokensPaymentUsageTokensGetSession? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageTokensPaymentUsageTokensGetSession; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs index b6ea2f10..a6da6e20 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class UsageTokensPaymentUsageTokensGetSession { @@ -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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs deleted file mode 100644 index fb5a3e73..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class UsageTokensPaymentUsageTokensGetTo - { - /// - /// 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.UsageTokensPaymentUsageTokensGetTo? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.UsageTokensPaymentUsageTokensGetTo), - jsonSerializerContext) as global::DeepInfra.UsageTokensPaymentUsageTokensGetTo; - } - - /// - /// 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.UsageTokensPaymentUsageTokensGetTo? 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.UsageTokensPaymentUsageTokensGetTo), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageTokensPaymentUsageTokensGetTo; - } - - /// - /// 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.UsageTokensPaymentUsageTokensGetTo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs deleted file mode 100644 index 47ef0820..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - public sealed partial class UsageTokensPaymentUsageTokensGetTo - { - - /// - /// 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.ValidationError.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.Json.g.cs index 50d69591..d73398c5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ValidationError; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ValidationError? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ValidationError; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs index 464b534c..60abdda7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs @@ -4,26 +4,26 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class ValidationError { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("loc")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList> Loc { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("msg")] [global::System.Text.Json.Serialization.JsonRequired] public required string Msg { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("type")] [global::System.Text.Json.Serialization.JsonRequired] @@ -60,5 +60,6 @@ public ValidationError( public ValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.Json.g.cs new file mode 100644 index 00000000..40c70369 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationIn), + jsonSerializerContext) as global::DeepInfra.VideoGenerationIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.VideoGenerationIn? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.VideoGenerationIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.g.cs new file mode 100644 index 00000000..e50c2c55 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.g.cs @@ -0,0 +1,120 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationIn + { + /// + /// + /// + [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")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Prompt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("negative_prompt")] + public string? NegativePrompt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("aspect_ratio")] + public string? AspectRatio { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("size")] + public string? Size { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seconds")] + public int? Seconds { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("seed")] + public int? Seed { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("style")] + public string? Style { get; set; } + + /// + /// First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("image_url")] + public string? ImageUrl { 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGenerationIn( + string model, + string prompt, + string? negativePrompt, + string? aspectRatio, + string? size, + int? seconds, + int? seed, + string? style, + string? imageUrl) + { + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); + this.NegativePrompt = negativePrompt; + this.AspectRatio = aspectRatio; + this.Size = size; + this.Seconds = seconds; + this.Seed = seed; + this.Style = style; + this.ImageUrl = imageUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGenerationIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOut.Json.g.cs new file mode 100644 index 00000000..4327a6b8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationOut), + jsonSerializerContext) as global::DeepInfra.VideoGenerationOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.VideoGenerationOut? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.VideoGenerationOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOut.g.cs new file mode 100644 index 00000000..e48fa7c5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOut.g.cs @@ -0,0 +1,104 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Default Value: video.generation.job + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public string? Object { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CreatedAt { 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("model")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Model { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public global::System.Collections.Generic.IList? Data { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("error")] + public string? Error { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// Default Value: video.generation.job + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoGenerationOut( + string id, + int createdAt, + string status, + string model, + string? @object, + global::System.Collections.Generic.IList? data, + string? error) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Object = @object; + this.CreatedAt = createdAt; + this.Status = status ?? throw new global::System.ArgumentNullException(nameof(status)); + this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); + this.Data = data; + this.Error = error; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGenerationOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutDataVariant1Item.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutDataVariant1Item.Json.g.cs new file mode 100644 index 00000000..1dd0f3ad --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutDataVariant1Item.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationOutDataVariant1Item + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationOutDataVariant1Item? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationOutDataVariant1Item), + jsonSerializerContext) as global::DeepInfra.VideoGenerationOutDataVariant1Item; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationOutDataVariant1Item? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.VideoGenerationOutDataVariant1Item? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.VideoGenerationOutDataVariant1Item), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationOutDataVariant1Item; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutDataVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutDataVariant1Item.g.cs new file mode 100644 index 00000000..a5c8a15d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutDataVariant1Item.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationOutDataVariant1Item + { + + /// + /// 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.VideoURL.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.Json.g.cs new file mode 100644 index 00000000..f01f9ae8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.Json.g.cs @@ -0,0 +1,141 @@ +#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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + 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 generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoURL? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.VideoURL? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.VideoURL), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoURL; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + 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..ce875421 --- /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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.Json.g.cs index 688ee796..01515011 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.Voice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.Voice? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.Voice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs index 1b7b2b85..d1a9618b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs @@ -4,45 +4,45 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class Voice { /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string UserId { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("voice_id")] [global::System.Text.Json.Serialization.JsonRequired] public required string VoiceId { 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("description")] public string? Description { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] public int? CreatedAt { get; set; } /// - /// + /// /// [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] public int? UpdatedAt { get; set; } @@ -87,5 +87,6 @@ public Voice( public Voice() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.Json.g.cs index 802c095e..7cf49635 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.WebLiveMetricsOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.DeserializeAsync( jsonStream, jsonSerializerOptions); diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs index e9124b13..02ec188c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// + /// /// public sealed partial class WebLiveMetricsOut { @@ -74,5 +74,6 @@ public WebLiveMetricsOut( public WebLiveMetricsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs deleted file mode 100644 index 80331fc2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class WebLiveMetricsOutRequestsPerSecond - { - /// - /// 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.WebLiveMetricsOutRequestsPerSecond? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.WebLiveMetricsOutRequestsPerSecond), - jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutRequestsPerSecond; - } - - /// - /// 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.WebLiveMetricsOutRequestsPerSecond? 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.WebLiveMetricsOutRequestsPerSecond), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutRequestsPerSecond; - } - - /// - /// 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.WebLiveMetricsOutRequestsPerSecond.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs deleted file mode 100644 index a381df5b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Requests per second - /// - public sealed partial class WebLiveMetricsOutRequestsPerSecond - { - - /// - /// 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.WebLiveMetricsOutTimeToFirstToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.Json.g.cs deleted file mode 100644 index 6a5d95a0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class WebLiveMetricsOutTimeToFirstToken - { - /// - /// 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.WebLiveMetricsOutTimeToFirstToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.WebLiveMetricsOutTimeToFirstToken), - jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutTimeToFirstToken; - } - - /// - /// 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.WebLiveMetricsOutTimeToFirstToken? 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.WebLiveMetricsOutTimeToFirstToken), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutTimeToFirstToken; - } - - /// - /// 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.WebLiveMetricsOutTimeToFirstToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs deleted file mode 100644 index 2f7decc3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Time to first token in seconds - /// - public sealed partial class WebLiveMetricsOutTimeToFirstToken - { - - /// - /// 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.WebLiveMetricsOutTokensPerSecond.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.Json.g.cs deleted file mode 100644 index 3d2724fc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class WebLiveMetricsOutTokensPerSecond - { - /// - /// 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.WebLiveMetricsOutTokensPerSecond? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.WebLiveMetricsOutTokensPerSecond), - jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutTokensPerSecond; - } - - /// - /// 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.WebLiveMetricsOutTokensPerSecond? 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.WebLiveMetricsOutTokensPerSecond), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutTokensPerSecond; - } - - /// - /// 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.WebLiveMetricsOutTokensPerSecond.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs deleted file mode 100644 index 2337b82e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Tokens per second - /// - public sealed partial class WebLiveMetricsOutTokensPerSecond - { - - /// - /// 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.WebLiveMetricsOutTotalTflops.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.Json.g.cs deleted file mode 100644 index dace188d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class WebLiveMetricsOutTotalTflops - { - /// - /// 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.WebLiveMetricsOutTotalTflops? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.WebLiveMetricsOutTotalTflops), - jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutTotalTflops; - } - - /// - /// 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.WebLiveMetricsOutTotalTflops? 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.WebLiveMetricsOutTotalTflops), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutTotalTflops; - } - - /// - /// 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.WebLiveMetricsOutTotalTflops.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs deleted file mode 100644 index 1fed5054..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Total TFLOPS - /// - public sealed partial class WebLiveMetricsOutTotalTflops - { - - /// - /// 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.WebSearchTool.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebSearchTool.Json.g.cs new file mode 100644 index 00000000..923b124b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebSearchTool.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class WebSearchTool + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.WebSearchTool? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.WebSearchTool), + jsonSerializerContext) as global::DeepInfra.WebSearchTool; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.WebSearchTool? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.WebSearchTool? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.WebSearchTool), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebSearchTool; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebSearchTool.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebSearchTool.g.cs new file mode 100644 index 00000000..b35d8c8c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebSearchTool.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class WebSearchTool + { + /// + /// + /// + /// "web_search" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = "web_search"; + + /// + /// Maximum results returned per search call. Values above 20 are clamped.
+ /// Default Value: 5 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("max_results")] + public int? MaxResults { get; set; } + + /// + /// Only results from these domains are kept. Entries are bare domains with an optional path prefix; a bare domain covers its subdomains. Wildcards are not supported. Mutually exclusive with exclude_domains. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("include_domains")] + public global::System.Collections.Generic.IList? IncludeDomains { get; set; } + + /// + /// Results from these domains are dropped. Entries are bare domains with an optional path prefix; a bare domain covers its subdomains. Wildcards are not supported. Mutually exclusive with include_domains. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("exclude_domains")] + public global::System.Collections.Generic.IList? ExcludeDomains { get; set; } + + /// + /// Steering text for how retrieved results are framed when injected into the model's context. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("search_prompt")] + public string? SearchPrompt { 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. + /// + /// + /// Maximum results returned per search call. Values above 20 are clamped.
+ /// Default Value: 5 + /// + /// + /// Only results from these domains are kept. Entries are bare domains with an optional path prefix; a bare domain covers its subdomains. Wildcards are not supported. Mutually exclusive with exclude_domains. + /// + /// + /// Results from these domains are dropped. Entries are bare domains with an optional path prefix; a bare domain covers its subdomains. Wildcards are not supported. Mutually exclusive with include_domains. + /// + /// + /// Steering text for how retrieved results are framed when injected into the model's context. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WebSearchTool( + int? maxResults, + global::System.Collections.Generic.IList? includeDomains, + global::System.Collections.Generic.IList? excludeDomains, + string? searchPrompt, + string type = "web_search") + { + this.Type = type; + this.MaxResults = maxResults; + this.IncludeDomains = includeDomains; + this.ExcludeDomains = excludeDomains; + this.SearchPrompt = searchPrompt; + } + + /// + /// Initializes a new instance of the class. + /// + public WebSearchTool() + { + } + + } +} \ 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..d8d4fa6a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.GetHardware.g.cs @@ -0,0 +1,496 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetHardwareRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string model, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetHardwareAsResponseAsync( + model: model, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetHardwareArguments( + httpClient: HttpClient, + model: ref model, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..9485f00a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelDelete.g.cs @@ -0,0 +1,575 @@ + +#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, + ref string? xApiKey); + partial void PrepareModelDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string version, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelDeleteAsResponseAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..bc85db26 --- /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..17ce4eac --- /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..df32a0d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs @@ -0,0 +1,647 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ModelMetaIn request); + partial void PrepareModelMetaUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelMetaUpdateAsResponseAsync( + modelName: modelName, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareModelMetaUpdateArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareModelMetaUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey, + 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: "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) + /// + /// + /// dataurl or regular url to a sample of this model's output, shown on the model page before the first run (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? xApiKey = default, + string? description = default, + string? githubUrl = default, + string? paperUrl = default, + string? licenseUrl = default, + string? readme = default, + string? coverImgUrl = default, + string? sampleOutputUrl = 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, + SampleOutputUrl = sampleOutputUrl, + ReportedType = reportedType, + }; + + return await ModelMetaUpdateAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..9920d933 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelPublicity.g.cs @@ -0,0 +1,649 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.ModelPublicityIn request); + partial void PrepareModelPublicityRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelPublicityAsResponseAsync( + modelName: modelName, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareModelPublicityArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareModelPublicityRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelName: modelName!, + xiApiKey: xiApiKey, + 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: "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)); + } + // 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); + 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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..c7cbf4e5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelSchema.g.cs @@ -0,0 +1,621 @@ + +#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, + ref string? xApiKey); + 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, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelSchemaAsResponseAsync( + modelName: modelName, + variantKey: variantKey, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..62ffdede --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelVersions.g.cs @@ -0,0 +1,526 @@ + +#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, + ref string? xApiKey); + partial void PrepareModelVersionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelVersionsAsResponseAsync( + modelName: modelName, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelVersionsArguments( + httpClient: HttpClient, + modelName: ref modelName, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..9eb1ba08 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsDeploymentList.g.cs @@ -0,0 +1,480 @@ + +#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, + ref string? xApiKey); + partial void PrepareModelsDeploymentListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsDeploymentListAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsDeploymentListArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..ddc86c96 --- /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..30aabc0d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsInfo.g.cs @@ -0,0 +1,538 @@ + +#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, + ref string? xApiKey); + partial void PrepareModelsInfoRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelName, + string? version, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsInfoAsResponseAsync( + modelName: modelName, + version: version, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..1ac08ab5 --- /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..0ab07be6 --- /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..20df67af --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenaiModels.g.cs @@ -0,0 +1,502 @@ + +#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, + ref string? xApiKey); + partial void PrepareOpenaiModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? sortBy, + string? filter, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiModelsAsResponseAsync( + sortBy: sortBy, + filter: filter, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..d40cf20b --- /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..dd1cbc4f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.PrivateModelsList.g.cs @@ -0,0 +1,480 @@ + +#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, + ref string? xApiKey); + partial void PreparePrivateModelsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PrivateModelsListAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PreparePrivateModelsListArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..20eadd1a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.OneOf.4.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.OneOf.4.Json.g.cs new file mode 100644 index 00000000..fd538113 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.OneOf.4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public readonly partial struct OneOf + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::DeepInfra.OneOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OneOf), + jsonSerializerContext) as global::DeepInfra.OneOf?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::DeepInfra.OneOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize>( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::DeepInfra.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OneOf?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.OneOf.4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.OneOf.4.g.cs new file mode 100644 index 00000000..b410b324 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.OneOf.4.g.cs @@ -0,0 +1,460 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public readonly partial struct OneOf : 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()}."); + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; + + /// + /// + /// + public OneOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(OneOf @this) => @this.Value2; + + /// + /// + /// + public OneOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T3 value) => new OneOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(OneOf @this) => @this.Value3; + + /// + /// + /// + public OneOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static OneOf FromValue3(T3? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T4 value) => new OneOf((T4?)value); + + /// + /// + /// + public static implicit operator T4?(OneOf @this) => @this.Value4; + + /// + /// + /// + public OneOf(T4? value) + { + Value4 = value; + } + + /// + /// + /// + public static OneOf FromValue4(T4? value) => new OneOf(value); + + /// + /// + /// + public OneOf( + T1? value1, + T2? value2, + T3? value3, + T4? value4 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + Value4 = value4; + } + + /// + /// + /// + public object? 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() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 && !IsValue2 && !IsValue3 && !IsValue4 || !IsValue1 && IsValue2 && !IsValue3 && !IsValue4 || !IsValue1 && !IsValue2 && IsValue3 && !IsValue4 || !IsValue1 && !IsValue2 && !IsValue3 && IsValue4; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + global::System.Func? value4 = 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!); + } + + 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, + 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, + 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 override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + Value4, + typeof(T4), + }; + 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(OneOf 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) + ; + } + + /// + /// + /// + public static bool operator ==(OneOf obj1, OneOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OneOf obj1, OneOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OneOf o && Equals(o); + } + } +} 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..90cad21e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs @@ -65,13 +65,14 @@ public PathBuilder AddRequiredParameter( /// The current instance. public PathBuilder AddRequiredParameter( string name, - global::System.Collections.Generic.IEnumerable value, + global::System.Collections.Generic.IEnumerable value, string delimiter = ",", bool explode = false) { + var nonNullValues = global::System.Linq.Enumerable.OfType(value); if (explode) { - foreach (var item in value) + foreach (var item in nonNullValues) { AddRequiredParameter($"{name}", item); } @@ -79,7 +80,7 @@ public PathBuilder AddRequiredParameter( return this; } - AddRequiredParameter(name, string.Join(delimiter, value)); + AddRequiredParameter(name, string.Join(delimiter, nonNullValues)); return this; } @@ -138,7 +139,7 @@ public PathBuilder AddOptionalParameter( /// The current instance. public PathBuilder AddOptionalParameter( string name, - global::System.Collections.Generic.IEnumerable? value, + global::System.Collections.Generic.IEnumerable? value, string delimiter = ",", bool explode = false) { @@ -224,6 +225,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. /// @@ -232,27 +267,32 @@ public PathBuilder AddOptionalParameter( } /// - /// + /// /// public class EndPointAuthorization { /// - /// + /// /// public string Type { get; set; } = string.Empty; /// - /// + /// + /// + public string SchemeId { get; set; } = string.Empty; + + /// + /// /// public string Location { get; set; } = string.Empty; /// - /// + /// /// public string Name { get; set; } = string.Empty; /// - /// + /// /// public string Value { 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..5a63e34c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs @@ -1,16 +1,16 @@ -#if !NET6_0_OR_GREATER #nullable enable namespace DeepInfra { /// - /// + /// /// public static partial class AutoSdkPolyfills { +#if !NET6_0_OR_GREATER /// - /// + /// /// /// /// @@ -23,7 +23,7 @@ public static partial class AutoSdkPolyfills return content.ReadAsStringAsync(); } /// - /// + /// /// /// /// @@ -36,7 +36,7 @@ public static partial class AutoSdkPolyfills return content.ReadAsStreamAsync(); } /// - /// + /// /// /// /// @@ -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.SandboxesClient.CreateSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.CreateSandbox.g.cs new file mode 100644 index 00000000..91c16214 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.CreateSandbox.g.cs @@ -0,0 +1,724 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateSandboxSecurityRequirement0 = + 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_CreateSandboxSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateSandboxSecurityRequirement0, + }; + partial void PrepareCreateSandboxArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.SandboxCreateIn request); + partial void PrepareCreateSandboxRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.SandboxCreateIn request); + partial void ProcessCreateSandboxResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateSandboxResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Sandbox
+ /// Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateSandboxAsync( + + global::DeepInfra.SandboxCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSandboxAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Sandbox
+ /// Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateSandboxAsResponseAsync( + + global::DeepInfra.SandboxCreateIn request, + string? xiApiKey = default, + 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); + PrepareCreateSandboxArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateSandboxSecurityRequirements, + operationName: "CreateSandboxAsync"); + + 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/sandboxes", + 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()); + } + 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); + PrepareCreateSandboxRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "CreateSandbox", + methodName: "CreateSandboxAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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: "CreateSandbox", + methodName: "CreateSandboxAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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: "CreateSandbox", + methodName: "CreateSandboxAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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); + ProcessCreateSandboxResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateSandbox", + methodName: "CreateSandboxAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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: "CreateSandbox", + methodName: "CreateSandboxAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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)); + } + // 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); + ProcessCreateSandboxResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.SandboxCreateOut.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.SandboxCreateOut.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 Sandbox
+ /// Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously. + ///
+ /// + /// + /// + /// + /// + /// 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 CreateSandboxAsync( + string? xiApiKey = default, + string? xApiKey = default, + string? plan = default, + global::System.Collections.Generic.Dictionary? tags = default, + int? timeoutSeconds = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.SandboxCreateIn + { + Plan = plan, + Tags = tags, + TimeoutSeconds = timeoutSeconds, + }; + + return await CreateSandboxAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.DeleteSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.DeleteSandbox.g.cs new file mode 100644 index 00000000..beb9be15 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.DeleteSandbox.g.cs @@ -0,0 +1,559 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeleteSandboxSecurityRequirement0 = + 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_DeleteSandboxSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeleteSandboxSecurityRequirement0, + }; + partial void PrepareDeleteSandboxArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareDeleteSandboxRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string? xiApiKey, + string? xApiKey); + partial void ProcessDeleteSandboxResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteSandboxResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteSandboxAsResponseAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteSandboxArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteSandboxSecurityRequirements, + operationName: "DeleteSandboxAsync"); + + 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/sandboxes/{sandboxId}", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteSandboxRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "DeleteSandbox", + methodName: "DeleteSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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: "DeleteSandbox", + methodName: "DeleteSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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: "DeleteSandbox", + methodName: "DeleteSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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); + ProcessDeleteSandboxResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteSandbox", + methodName: "DeleteSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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: "DeleteSandbox", + methodName: "DeleteSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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); + ProcessDeleteSandboxResponseContent( + 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.SandboxesClient.ExecCommand.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ExecCommand.g.cs new file mode 100644 index 00000000..d8866ec4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ExecCommand.g.cs @@ -0,0 +1,693 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ExecCommandSecurityRequirement0 = + 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_ExecCommandSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ExecCommandSecurityRequirement0, + }; + partial void PrepareExecCommandArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.SandboxExecIn request); + partial void PrepareExecCommandRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.SandboxExecIn request); + partial void ProcessExecCommandResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessExecCommandResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Exec Command
+ /// Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ExecCommandAsync( + string sandboxId, + + global::DeepInfra.SandboxExecIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExecCommandAsResponseAsync( + sandboxId: sandboxId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Exec Command
+ /// Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ExecCommandAsResponseAsync( + string sandboxId, + + global::DeepInfra.SandboxExecIn request, + string? xiApiKey = default, + 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); + PrepareExecCommandArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ExecCommandSecurityRequirements, + operationName: "ExecCommandAsync"); + + 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/sandboxes/{sandboxId}/exec", + 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()); + } + 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); + PrepareExecCommandRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + xiApiKey: xiApiKey, + 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: "ExecCommand", + methodName: "ExecCommandAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/exec\"", + 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: "ExecCommand", + methodName: "ExecCommandAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/exec\"", + 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: "ExecCommand", + methodName: "ExecCommandAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/exec\"", + 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); + ProcessExecCommandResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ExecCommand", + methodName: "ExecCommandAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/exec\"", + 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: "ExecCommand", + methodName: "ExecCommandAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/exec\"", + 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)); + } + // 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); + ProcessExecCommandResponseContent( + 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(); + } + } + /// + /// Exec Command
+ /// Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {"stdout": ...}/{"stderr": ...} chunks followed by exactly one terminal {"returncode": N} or {"error": msg} line. + ///
+ /// + /// + /// + /// + /// + /// Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).
+ /// 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 ExecCommandAsync( + string sandboxId, + global::System.Collections.Generic.IList command, + string? xiApiKey = default, + string? xApiKey = default, + int? timeoutSeconds = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.SandboxExecIn + { + Command = command, + TimeoutSeconds = timeoutSeconds, + }; + + return await ExecCommandAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.GetSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.GetSandbox.g.cs new file mode 100644 index 00000000..94926a19 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.GetSandbox.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetSandboxSecurityRequirement0 = + 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_GetSandboxSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetSandboxSecurityRequirement0, + }; + partial void PrepareGetSandboxArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetSandboxRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetSandboxResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetSandboxResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSandboxAsResponseAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetSandboxArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetSandboxSecurityRequirements, + operationName: "GetSandboxAsync"); + + 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/sandboxes/{sandboxId}", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetSandboxRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetSandbox", + methodName: "GetSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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: "GetSandbox", + methodName: "GetSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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: "GetSandbox", + methodName: "GetSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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); + ProcessGetSandboxResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetSandbox", + methodName: "GetSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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: "GetSandbox", + methodName: "GetSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}\"", + 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); + ProcessGetSandboxResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.SandboxOut.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.SandboxOut.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.SandboxesClient.ListSandboxPlans.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ListSandboxPlans.g.cs new file mode 100644 index 00000000..98713f7e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ListSandboxPlans.g.cs @@ -0,0 +1,556 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListSandboxPlansSecurityRequirement0 = + 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_ListSandboxPlansSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListSandboxPlansSecurityRequirement0, + }; + partial void PrepareListSandboxPlansArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareListSandboxPlansRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessListSandboxPlansResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListSandboxPlansResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Sandbox Plans
+ /// Returns all available sandbox plans with their resource specs and pricing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListSandboxPlansAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListSandboxPlansAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Sandbox Plans
+ /// Returns all available sandbox plans with their resource specs and pricing. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListSandboxPlansAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListSandboxPlansArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListSandboxPlansSecurityRequirements, + operationName: "ListSandboxPlansAsync"); + + 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/sandboxes/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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListSandboxPlansRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "ListSandboxPlans", + methodName: "ListSandboxPlansAsync", + pathTemplate: "\"/v1/sandboxes/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: "ListSandboxPlans", + methodName: "ListSandboxPlansAsync", + pathTemplate: "\"/v1/sandboxes/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: "ListSandboxPlans", + methodName: "ListSandboxPlansAsync", + pathTemplate: "\"/v1/sandboxes/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); + ProcessListSandboxPlansResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSandboxPlans", + methodName: "ListSandboxPlansAsync", + pathTemplate: "\"/v1/sandboxes/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: "ListSandboxPlans", + methodName: "ListSandboxPlansAsync", + pathTemplate: "\"/v1/sandboxes/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); + ProcessListSandboxPlansResponseContent( + 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.SandboxesClient.ListSandboxes.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ListSandboxes.g.cs new file mode 100644 index 00000000..26f22858 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ListSandboxes.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListSandboxesSecurityRequirement0 = + 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_ListSandboxesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListSandboxesSecurityRequirement0, + }; + partial void PrepareListSandboxesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareListSandboxesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessListSandboxesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListSandboxesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Sandboxes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListSandboxesAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListSandboxesAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Sandboxes + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ListSandboxesAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListSandboxesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListSandboxesSecurityRequirements, + operationName: "ListSandboxesAsync"); + + 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/sandboxes", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListSandboxesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "ListSandboxes", + methodName: "ListSandboxesAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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: "ListSandboxes", + methodName: "ListSandboxesAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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: "ListSandboxes", + methodName: "ListSandboxesAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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); + ProcessListSandboxesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListSandboxes", + methodName: "ListSandboxesAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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: "ListSandboxes", + methodName: "ListSandboxesAsync", + pathTemplate: "\"/v1/sandboxes\"", + 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); + ProcessListSandboxesResponseContent( + 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.SandboxesClient.ReadFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ReadFile.g.cs new file mode 100644 index 00000000..aaf2268a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.ReadFile.g.cs @@ -0,0 +1,647 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ReadFileSecurityRequirement0 = + 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_ReadFileSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ReadFileSecurityRequirement0, + }; + partial void PrepareReadFileArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string path, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareReadFileRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string path, + string? xiApiKey, + string? xApiKey); + partial void ProcessReadFileResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessReadFileResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Read File
+ /// Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-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 ReadFileAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ReadFileAsResponseAsync( + sandboxId: sandboxId, + path: path, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Read File
+ /// Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-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> ReadFileAsResponseAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareReadFileArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + path: ref path, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ReadFileSecurityRequirements, + operationName: "ReadFileAsync"); + + 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/sandboxes/{sandboxId}/fs/content", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("path", path) + ; + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareReadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + path: path!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "ReadFile", + methodName: "ReadFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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: "ReadFile", + methodName: "ReadFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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: "ReadFile", + methodName: "ReadFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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); + ProcessReadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ReadFile", + methodName: "ReadFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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: "ReadFile", + methodName: "ReadFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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)); + } + // 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); + ProcessReadFileResponseContent( + 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.SandboxesClient.StartSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.StartSandbox.g.cs new file mode 100644 index 00000000..0ff7eb48 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.StartSandbox.g.cs @@ -0,0 +1,670 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_StartSandboxSecurityRequirement0 = + 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_StartSandboxSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_StartSandboxSecurityRequirement0, + }; + partial void PrepareStartSandboxArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareStartSandboxRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string? xiApiKey, + string? xApiKey); + partial void ProcessStartSandboxResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessStartSandboxResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Start Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task StartSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StartSandboxAsResponseAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Start Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> StartSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStartSandboxArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StartSandboxSecurityRequirements, + operationName: "StartSandboxAsync"); + + 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/sandboxes/{sandboxId}/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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStartSandboxRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "StartSandbox", + methodName: "StartSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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: "StartSandbox", + methodName: "StartSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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: "StartSandbox", + methodName: "StartSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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); + ProcessStartSandboxResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StartSandbox", + methodName: "StartSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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: "StartSandbox", + methodName: "StartSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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)); + } + // 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); + ProcessStartSandboxResponseContent( + 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.SandboxesClient.StopSandbox.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.StopSandbox.g.cs new file mode 100644 index 00000000..58c0e530 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.StopSandbox.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_StopSandboxSecurityRequirement0 = + 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_StopSandboxSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_StopSandboxSecurityRequirement0, + }; + partial void PrepareStopSandboxArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareStopSandboxRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string? xiApiKey, + string? xApiKey); + partial void ProcessStopSandboxResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessStopSandboxResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Stop Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task StopSandboxAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StopSandboxAsResponseAsync( + sandboxId: sandboxId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Stop Sandbox + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> StopSandboxAsResponseAsync( + string sandboxId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStopSandboxArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StopSandboxSecurityRequirements, + operationName: "StopSandboxAsync"); + + 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/sandboxes/{sandboxId}/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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStopSandboxRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "StopSandbox", + methodName: "StopSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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: "StopSandbox", + methodName: "StopSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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: "StopSandbox", + methodName: "StopSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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); + ProcessStopSandboxResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StopSandbox", + methodName: "StopSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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: "StopSandbox", + methodName: "StopSandboxAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/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); + ProcessStopSandboxResponseContent( + 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.SandboxesClient.WriteFile.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.WriteFile.g.cs new file mode 100644 index 00000000..be33722c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.WriteFile.g.cs @@ -0,0 +1,684 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class SandboxesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_WriteFileSecurityRequirement0 = + 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_WriteFileSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_WriteFileSecurityRequirement0, + }; + partial void PrepareWriteFileArguments( + global::System.Net.Http.HttpClient httpClient, + ref string sandboxId, + ref string path, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareWriteFileRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string sandboxId, + string path, + string? xiApiKey, + string? xApiKey); + partial void ProcessWriteFileResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessWriteFileResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Write File
+ /// Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task WriteFileAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await WriteFileAsResponseAsync( + sandboxId: sandboxId, + path: path, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Write File
+ /// Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox. + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> WriteFileAsResponseAsync( + string sandboxId, + string path, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareWriteFileArguments( + httpClient: HttpClient, + sandboxId: ref sandboxId, + path: ref path, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_WriteFileSecurityRequirements, + operationName: "WriteFileAsync"); + + 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/sandboxes/{sandboxId}/fs/content", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("path", path) + ; + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareWriteFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + sandboxId: sandboxId!, + path: path!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "WriteFile", + methodName: "WriteFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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: "WriteFile", + methodName: "WriteFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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: "WriteFile", + methodName: "WriteFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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); + ProcessWriteFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "WriteFile", + methodName: "WriteFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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: "WriteFile", + methodName: "WriteFileAsync", + pathTemplate: "$\"/v1/sandboxes/{sandboxId}/fs/content\"", + 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)); + } + // 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)); + } + // Request Entity Too Large + if ((int)__response.StatusCode == 413) + { + string? __content_413 = null; + global::System.Exception? __exception_413 = null; + global::DeepInfra.DeepError? __value_413 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_413 = global::DeepInfra.DeepError.FromJson(__content_413, JsonSerializerContext); + } + else + { + __content_413 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_413 = global::DeepInfra.DeepError.FromJson(__content_413, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_413 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_413 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_413, + responseBody: __content_413, + responseObject: __value_413, + 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); + ProcessWriteFileResponseContent( + 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.SandboxesClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.g.cs new file mode 100644 index 00000000..5768a2c2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.SandboxesClient.g.cs @@ -0,0 +1,144 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Create and manage isolated sandbox environments.
+ /// 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 SandboxesClient : global::DeepInfra.ISandboxesClient, 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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the SandboxesClient. + /// 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 SandboxesClient( + 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 SandboxesClient 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 SandboxesClient( + 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 SandboxesClient. + /// 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 SandboxesClient( + 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.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..7ef229ff --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs @@ -0,0 +1,688 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.OpenAICompletionsIn request); + partial void PrepareOpenaiCompletionsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xDeepinfraSource, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenaiCompletionsAsResponseAsync( + + request: request, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareOpenaiCompletionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareOpenaiCompletionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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: "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 + /// + /// + /// + /// + /// + /// The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'. + /// + /// + /// If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
+ /// Default Value: false + /// + /// + /// Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence. + /// + /// + /// 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 65536, 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. + /// + /// + /// Prompt cache options for this request's prefix, e.g. {"ttl": "1h"}. + /// + /// + /// 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,...'). + /// + /// + /// Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed. + /// + /// Per-request overrides 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, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? failFast = default, + global::System.Collections.Generic.IList? models = 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.PromptCacheOptions? promptCacheOptions = default, + global::DeepInfra.CompletionMultiModalData? data = default, + bool? ignoreEos = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAICompletionsIn + { + ServiceTier = serviceTier, + FailFast = failFast, + Models = models, + 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, + PromptCacheOptions = promptCacheOptions, + Data = data, + IgnoreEos = ignoreEos, + }; + + return await OpenaiCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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..e573dcc0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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..df7a4f69 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs @@ -0,0 +1,1643 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); + partial void PrepareCreateVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVoiceAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareCreateVoiceArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __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, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __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, + 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: "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, + string? xApiKey = 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, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); + __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, + 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: "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..76089c69 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.DeleteVoice.g.cs @@ -0,0 +1,559 @@ + +#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, + ref string? xApiKey); + partial void PrepareDeleteVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteVoiceAsResponseAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteVoiceArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..1202ea7e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoice.g.cs @@ -0,0 +1,528 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVoiceAsResponseAsync( + voiceId: voiceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVoiceArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..4dcf412c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.GetVoices.g.cs @@ -0,0 +1,519 @@ + +#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, + ref string? xApiKey); + partial void PrepareGetVoicesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVoicesAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVoicesArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.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, + xApiKey: xApiKey); + + 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..7c4ffdd9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeech.g.cs @@ -0,0 +1,570 @@ + +#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, + ref string? xApiKey, + 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, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TextToSpeechAsResponseAsync( + voiceId: voiceId, + + request: request, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareTextToSpeechArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + outputFormat: ref outputFormat, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareTextToSpeechRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..de01edce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.TextToSpeechStream.g.cs @@ -0,0 +1,570 @@ + +#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, + ref string? xApiKey, + 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, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TextToSpeechStreamAsResponseAsync( + voiceId: voiceId, + + request: request, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareTextToSpeechStreamArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + outputFormat: ref outputFormat, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareTextToSpeechStreamRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + outputFormat: outputFormat, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..120ca74c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.UpdateVoice.g.cs @@ -0,0 +1,621 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); + partial void PrepareUpdateVoiceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string voiceId, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateVoiceAsResponseAsync( + voiceId: voiceId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareUpdateVoiceArguments( + httpClient: HttpClient, + voiceId: ref voiceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + var __formValues = new global::System.Collections.Generic.List>(); + __formValues.Add(new global::System.Collections.Generic.KeyValuePair( + "name", + request.Name ?? string.Empty)); + __formValues.Add(new global::System.Collections.Generic.KeyValuePair( + "description", + request.Description ?? string.Empty)); + var __httpRequestContent = new global::System.Net.Http.FormUrlEncodedContent(__formValues); + __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, + 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: "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, + string? xApiKey = 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, + xApiKey: xApiKey, + 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..0b516522 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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.TokenizerClient.Detokenize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Detokenize.g.cs new file mode 100644 index 00000000..99addbe3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Detokenize.g.cs @@ -0,0 +1,535 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TokenizerClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DetokenizeSecurityRequirement0 = + 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_DetokenizeSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DetokenizeSecurityRequirement0, + }; + partial void PrepareDetokenizeArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.DetokenizeIn request); + partial void PrepareDetokenizeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.DetokenizeIn request); + partial void ProcessDetokenizeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDetokenizeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Detokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DetokenizeAsync( + + global::DeepInfra.DetokenizeIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DetokenizeAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Detokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DetokenizeAsResponseAsync( + + global::DeepInfra.DetokenizeIn request, + string? xiApiKey = default, + 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); + PrepareDetokenizeArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DetokenizeSecurityRequirements, + operationName: "DetokenizeAsync"); + + 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/detokenize", + 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()); + } + 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); + PrepareDetokenizeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "Detokenize", + methodName: "DetokenizeAsync", + pathTemplate: "\"/v1/detokenize\"", + 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: "Detokenize", + methodName: "DetokenizeAsync", + pathTemplate: "\"/v1/detokenize\"", + 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: "Detokenize", + methodName: "DetokenizeAsync", + pathTemplate: "\"/v1/detokenize\"", + 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); + ProcessDetokenizeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Detokenize", + methodName: "DetokenizeAsync", + pathTemplate: "\"/v1/detokenize\"", + 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: "Detokenize", + methodName: "DetokenizeAsync", + pathTemplate: "\"/v1/detokenize\"", + 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); + ProcessDetokenizeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DetokenizeOut.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.DetokenizeOut.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(); + } + } + /// + /// Detokenize + /// + /// + /// + /// + /// model name + /// + /// + /// token ids to detokenize + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DetokenizeAsync( + string model, + string? xiApiKey = default, + string? xApiKey = default, + global::System.Collections.Generic.IList? tokens = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DetokenizeIn + { + Model = model, + Tokens = tokens, + }; + + return await DetokenizeAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Tokenize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Tokenize.g.cs new file mode 100644 index 00000000..4d07079d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Tokenize.g.cs @@ -0,0 +1,545 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class TokenizerClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_TokenizeSecurityRequirement0 = + 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_TokenizeSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_TokenizeSecurityRequirement0, + }; + partial void PrepareTokenizeArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.TokenizeIn request); + partial void PrepareTokenizeRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.TokenizeIn request); + partial void ProcessTokenizeResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessTokenizeResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Tokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TokenizeAsync( + + global::DeepInfra.TokenizeIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await TokenizeAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Tokenize + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> TokenizeAsResponseAsync( + + global::DeepInfra.TokenizeIn request, + string? xiApiKey = default, + 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); + PrepareTokenizeArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_TokenizeSecurityRequirements, + operationName: "TokenizeAsync"); + + 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/tokenize", + 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()); + } + 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); + PrepareTokenizeRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "Tokenize", + methodName: "TokenizeAsync", + pathTemplate: "\"/v1/tokenize\"", + 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: "Tokenize", + methodName: "TokenizeAsync", + pathTemplate: "\"/v1/tokenize\"", + 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: "Tokenize", + methodName: "TokenizeAsync", + pathTemplate: "\"/v1/tokenize\"", + 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); + ProcessTokenizeResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Tokenize", + methodName: "TokenizeAsync", + pathTemplate: "\"/v1/tokenize\"", + 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: "Tokenize", + methodName: "TokenizeAsync", + pathTemplate: "\"/v1/tokenize\"", + 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); + ProcessTokenizeResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.TokenizeOut.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.TokenizeOut.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(); + } + } + /// + /// Tokenize + /// + /// + /// + /// + /// model name + /// + /// + /// text to tokenize (completion form) + /// + /// + /// chat messages to tokenize (chat form) + /// + /// + /// also return the per-token strings (vLLM) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task TokenizeAsync( + string model, + string? xiApiKey = default, + string? xApiKey = default, + string? prompt = default, + global::System.Collections.Generic.IList? messages = default, + bool? returnTokenStrs = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.TokenizeIn + { + Model = model, + Prompt = prompt, + Messages = messages, + ReturnTokenStrs = returnTokenStrs, + }; + + return await TokenizeAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.g.cs new file mode 100644 index 00000000..83143288 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.g.cs @@ -0,0 +1,143 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// 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 TokenizerClient : global::DeepInfra.ITokenizerClient, 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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the TokenizerClient. + /// 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 TokenizerClient( + 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 TokenizerClient 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 TokenizerClient( + 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 TokenizerClient. + /// 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 TokenizerClient( + 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..3b833989 --- /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..b71ffcc8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.SubmitFeedback.g.cs @@ -0,0 +1,571 @@ + +#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, + ref string? xApiKey, + global::DeepInfra.FeedbackIn request); + partial void PrepareSubmitFeedbackRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + 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, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SubmitFeedbackAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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, + 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); + PrepareSubmitFeedbackArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + 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()); + } + 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); + PrepareSubmitFeedbackRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "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? xApiKey = 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, + xApiKey: xApiKey, + 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..bed0d4be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.g.cs @@ -0,0 +1,144 @@ + +#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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// 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/DeepInfra.VideosClient.CreateVideoGeneration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration.g.cs new file mode 100644 index 00000000..9bf52244 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class VideosClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateVideoGenerationSecurityRequirement0 = + 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_CreateVideoGenerationSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateVideoGenerationSecurityRequirement0, + }; + partial void PrepareCreateVideoGenerationArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.VideoGenerationIn request); + partial void PrepareCreateVideoGenerationRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.VideoGenerationIn request); + partial void ProcessCreateVideoGenerationResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateVideoGenerationResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateVideoGenerationAsync( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVideoGenerationAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateVideoGenerationAsResponseAsync( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + 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); + PrepareCreateVideoGenerationArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateVideoGenerationSecurityRequirements, + operationName: "CreateVideoGenerationAsync"); + + 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/videos", + 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()); + } + 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); + PrepareCreateVideoGenerationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "CreateVideoGeneration", + methodName: "CreateVideoGenerationAsync", + pathTemplate: "\"/v1/videos\"", + 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: "CreateVideoGeneration", + methodName: "CreateVideoGenerationAsync", + pathTemplate: "\"/v1/videos\"", + 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: "CreateVideoGeneration", + methodName: "CreateVideoGenerationAsync", + pathTemplate: "\"/v1/videos\"", + 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); + ProcessCreateVideoGenerationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVideoGeneration", + methodName: "CreateVideoGenerationAsync", + pathTemplate: "\"/v1/videos\"", + 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: "CreateVideoGeneration", + methodName: "CreateVideoGenerationAsync", + pathTemplate: "\"/v1/videos\"", + 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); + ProcessCreateVideoGenerationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.VideoGenerationOut.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.VideoGenerationOut.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 Video Generation + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateVideoGenerationAsync( + string model, + string prompt, + string? xiApiKey = default, + string? xApiKey = default, + string? negativePrompt = default, + string? aspectRatio = default, + string? size = default, + int? seconds = default, + int? seed = default, + string? style = default, + string? imageUrl = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.VideoGenerationIn + { + Model = model, + Prompt = prompt, + NegativePrompt = negativePrompt, + AspectRatio = aspectRatio, + Size = size, + Seconds = seconds, + Seed = seed, + Style = style, + ImageUrl = imageUrl, + }; + + return await CreateVideoGenerationAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration2.g.cs new file mode 100644 index 00000000..4c19e34e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration2.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class VideosClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CreateVideoGeneration2SecurityRequirement0 = + 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_CreateVideoGeneration2SecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CreateVideoGeneration2SecurityRequirement0, + }; + partial void PrepareCreateVideoGeneration2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.VideoGenerationIn request); + partial void PrepareCreateVideoGeneration2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.VideoGenerationIn request); + partial void ProcessCreateVideoGeneration2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateVideoGeneration2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateVideoGeneration2Async( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateVideoGeneration2AsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateVideoGeneration2AsResponseAsync( + + global::DeepInfra.VideoGenerationIn request, + string? xiApiKey = default, + 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); + PrepareCreateVideoGeneration2Arguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateVideoGeneration2SecurityRequirements, + operationName: "CreateVideoGeneration2Async"); + + 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/openai/videos", + 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()); + } + 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); + PrepareCreateVideoGeneration2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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: "CreateVideoGeneration2", + methodName: "CreateVideoGeneration2Async", + pathTemplate: "\"/v1/openai/videos\"", + 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: "CreateVideoGeneration2", + methodName: "CreateVideoGeneration2Async", + pathTemplate: "\"/v1/openai/videos\"", + 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: "CreateVideoGeneration2", + methodName: "CreateVideoGeneration2Async", + pathTemplate: "\"/v1/openai/videos\"", + 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); + ProcessCreateVideoGeneration2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateVideoGeneration2", + methodName: "CreateVideoGeneration2Async", + pathTemplate: "\"/v1/openai/videos\"", + 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: "CreateVideoGeneration2", + methodName: "CreateVideoGeneration2Async", + pathTemplate: "\"/v1/openai/videos\"", + 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); + ProcessCreateVideoGeneration2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.VideoGenerationOut.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.VideoGenerationOut.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 Video Generation + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateVideoGeneration2Async( + string model, + string prompt, + string? xiApiKey = default, + string? xApiKey = default, + string? negativePrompt = default, + string? aspectRatio = default, + string? size = default, + int? seconds = default, + int? seed = default, + string? style = default, + string? imageUrl = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.VideoGenerationIn + { + Model = model, + Prompt = prompt, + NegativePrompt = negativePrompt, + AspectRatio = aspectRatio, + Size = size, + Seconds = seconds, + Seed = seed, + Style = style, + ImageUrl = imageUrl, + }; + + return await CreateVideoGeneration2Async( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoContent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoContent.g.cs new file mode 100644 index 00000000..02582d55 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoContent.g.cs @@ -0,0 +1,501 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class VideosClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetVideoContentSecurityRequirement0 = + 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_GetVideoContentSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetVideoContentSecurityRequirement0, + }; + partial void PrepareGetVideoContentArguments( + global::System.Net.Http.HttpClient httpClient, + ref string videoId, + ref string? variant, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetVideoContentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string videoId, + string? variant, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetVideoContentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetVideoContentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetVideoContentAsync( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVideoContentAsResponseAsync( + videoId: videoId, + variant: variant, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVideoContentAsResponseAsync( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVideoContentArguments( + httpClient: HttpClient, + videoId: ref videoId, + variant: ref variant, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetVideoContentSecurityRequirements, + operationName: "GetVideoContentAsync"); + + 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/videos/{videoId}/content", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("variant", variant) + ; + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVideoContentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + videoId: videoId!, + variant: variant, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetVideoContent", + methodName: "GetVideoContentAsync", + pathTemplate: "$\"/v1/videos/{videoId}/content\"", + 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: "GetVideoContent", + methodName: "GetVideoContentAsync", + pathTemplate: "$\"/v1/videos/{videoId}/content\"", + 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: "GetVideoContent", + methodName: "GetVideoContentAsync", + pathTemplate: "$\"/v1/videos/{videoId}/content\"", + 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); + ProcessGetVideoContentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVideoContent", + methodName: "GetVideoContentAsync", + pathTemplate: "$\"/v1/videos/{videoId}/content\"", + 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: "GetVideoContent", + methodName: "GetVideoContentAsync", + pathTemplate: "$\"/v1/videos/{videoId}/content\"", + 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); + ProcessGetVideoContentResponseContent( + 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.VideosClient.GetVideoContent2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoContent2.g.cs new file mode 100644 index 00000000..d321fa17 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoContent2.g.cs @@ -0,0 +1,501 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class VideosClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetVideoContent2SecurityRequirement0 = + 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_GetVideoContent2SecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetVideoContent2SecurityRequirement0, + }; + partial void PrepareGetVideoContent2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string videoId, + ref string? variant, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetVideoContent2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string videoId, + string? variant, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetVideoContent2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetVideoContent2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetVideoContent2Async( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVideoContent2AsResponseAsync( + videoId: videoId, + variant: variant, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Video Content + /// + /// + /// + /// Default Value: video + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVideoContent2AsResponseAsync( + string videoId, + string? variant = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVideoContent2Arguments( + httpClient: HttpClient, + videoId: ref videoId, + variant: ref variant, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetVideoContent2SecurityRequirements, + operationName: "GetVideoContent2Async"); + + 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/openai/videos/{videoId}/content", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("variant", variant) + ; + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVideoContent2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + videoId: videoId!, + variant: variant, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetVideoContent2", + methodName: "GetVideoContent2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}/content\"", + 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: "GetVideoContent2", + methodName: "GetVideoContent2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}/content\"", + 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: "GetVideoContent2", + methodName: "GetVideoContent2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}/content\"", + 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); + ProcessGetVideoContent2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVideoContent2", + methodName: "GetVideoContent2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}/content\"", + 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: "GetVideoContent2", + methodName: "GetVideoContent2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}/content\"", + 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); + ProcessGetVideoContent2ResponseContent( + 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.VideosClient.GetVideoGeneration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoGeneration.g.cs new file mode 100644 index 00000000..5d9f9a0e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoGeneration.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class VideosClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetVideoGenerationSecurityRequirement0 = + 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_GetVideoGenerationSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetVideoGenerationSecurityRequirement0, + }; + partial void PrepareGetVideoGenerationArguments( + global::System.Net.Http.HttpClient httpClient, + ref string videoId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetVideoGenerationRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string videoId, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetVideoGenerationResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetVideoGenerationResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetVideoGenerationAsync( + string videoId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVideoGenerationAsResponseAsync( + videoId: videoId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVideoGenerationAsResponseAsync( + string videoId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVideoGenerationArguments( + httpClient: HttpClient, + videoId: ref videoId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetVideoGenerationSecurityRequirements, + operationName: "GetVideoGenerationAsync"); + + 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/videos/{videoId}", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVideoGenerationRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + videoId: videoId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetVideoGeneration", + methodName: "GetVideoGenerationAsync", + pathTemplate: "$\"/v1/videos/{videoId}\"", + 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: "GetVideoGeneration", + methodName: "GetVideoGenerationAsync", + pathTemplate: "$\"/v1/videos/{videoId}\"", + 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: "GetVideoGeneration", + methodName: "GetVideoGenerationAsync", + pathTemplate: "$\"/v1/videos/{videoId}\"", + 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); + ProcessGetVideoGenerationResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVideoGeneration", + methodName: "GetVideoGenerationAsync", + pathTemplate: "$\"/v1/videos/{videoId}\"", + 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: "GetVideoGeneration", + methodName: "GetVideoGenerationAsync", + pathTemplate: "$\"/v1/videos/{videoId}\"", + 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); + ProcessGetVideoGenerationResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.VideoGenerationOut.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.VideoGenerationOut.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.VideosClient.GetVideoGeneration2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoGeneration2.g.cs new file mode 100644 index 00000000..716fa130 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.GetVideoGeneration2.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class VideosClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetVideoGeneration2SecurityRequirement0 = + 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_GetVideoGeneration2SecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetVideoGeneration2SecurityRequirement0, + }; + partial void PrepareGetVideoGeneration2Arguments( + global::System.Net.Http.HttpClient httpClient, + ref string videoId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareGetVideoGeneration2Request( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string videoId, + string? xiApiKey, + string? xApiKey); + partial void ProcessGetVideoGeneration2Response( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetVideoGeneration2ResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetVideoGeneration2Async( + string videoId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetVideoGeneration2AsResponseAsync( + videoId: videoId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Video Generation + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetVideoGeneration2AsResponseAsync( + string videoId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetVideoGeneration2Arguments( + httpClient: HttpClient, + videoId: ref videoId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetVideoGeneration2SecurityRequirements, + operationName: "GetVideoGeneration2Async"); + + 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/openai/videos/{videoId}", + 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()); + } + if (xApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); + } + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetVideoGeneration2Request( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + videoId: videoId!, + xiApiKey: xiApiKey, + xApiKey: xApiKey); + + 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: "GetVideoGeneration2", + methodName: "GetVideoGeneration2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}\"", + 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: "GetVideoGeneration2", + methodName: "GetVideoGeneration2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}\"", + 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: "GetVideoGeneration2", + methodName: "GetVideoGeneration2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}\"", + 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); + ProcessGetVideoGeneration2Response( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetVideoGeneration2", + methodName: "GetVideoGeneration2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}\"", + 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: "GetVideoGeneration2", + methodName: "GetVideoGeneration2Async", + pathTemplate: "$\"/v1/openai/videos/{videoId}\"", + 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); + ProcessGetVideoGeneration2ResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.VideoGenerationOut.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.VideoGenerationOut.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.VideosClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.g.cs new file mode 100644 index 00000000..4849169c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.g.cs @@ -0,0 +1,143 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// 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 VideosClient : global::DeepInfra.IVideosClient, 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; } + + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::DeepInfra.SourceGenerationContext.Default); + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext + { + get => JsonSerializerContextProvider.Value; + set => JsonSerializerContextProvider = new(() => value); + } + + + /// + /// Creates a new instance of the VideosClient. + /// 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 VideosClient( + 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 VideosClient 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 VideosClient( + 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 VideosClient. + /// 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 VideosClient( + 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..700a485e --- /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}}\nx-api-key: {{x-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}}\nx-api-key: {{x-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..087ef587 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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"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/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/gpu_pool/gpu_types":{"get":{"tags":["Account"],"summary":"Gpu Pool Gpu Types","operationId":"gpu_pool_gpu_types_v1_gpu_pool_gpu_types_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpuTypesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/gpu_pool":{"get":{"tags":["Account"],"summary":"Account Gpu Pool","operationId":"account_gpu_pool_v1_me_gpu_pool_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GpuPoolOut"}}}},"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_pool/request":{"post":{"tags":["Account"],"summary":"Request Gpu Pool Change","operationId":"request_gpu_pool_change_v1_me_gpu_pool_request_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/GpuPoolRequestIn"}}}},"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"}}}}}}},"/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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/standard_args":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Llm Standard Args","operationId":"deploy_llm_standard_args_deploy_llm_standard_args_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"engine","in":"query","required":false,"schema":{"type":"string","default":"vllm","title":"Engine"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Deploy Llm Standard Args Deploy Llm Standard Args Get"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/deploy/llm/presets":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Llm Presets","description":"DeepInfra presets and mirrored vLLM recipes for ``hf_repo_id``, told apart by\n``source``; empty when none. Filter by ``gpu``/``engine``/``source``.","operationId":"deploy_llm_presets_deploy_llm_presets_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hf_repo_id","in":"query","required":true,"schema":{"type":"string","title":"Hf Repo Id"}},{"name":"gpu","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DeployGPUs"},{"type":"null"}],"title":"Gpu"}},{"name":"engine","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PresetConfigOut"},"title":"Response Deploy Llm Presets Deploy Llm Presets Get"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unprocessable Entity"}}}},"/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"}},{"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/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"},"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"}}}},"/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,updating,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,updating,stopped,failed,deleted"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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,updating,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,updating,stopped,failed,deleted"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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}/config/history":{"get":{"tags":["Dedicated Models"],"summary":"Deploy Args History","operationId":"deploy_args_history_deploy__deploy_id__config_history_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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeployArgsHistoryOut"},"title":"Response Deploy Args History Deploy Deploy Id Config History Get"}}}},"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"}}}}}}},"/deploy/{deploy_id}/config/history/{entry_id}/restore":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Args Restore","operationId":"deploy_args_restore_deploy__deploy_id__config_history__entry_id__restore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deploy_id","in":"path","required":true,"schema":{"type":"string","title":"Deploy Id"}},{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"},"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"}}}}}}},"/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/tokenize":{"post":{"tags":["Tokenizer"],"summary":"Tokenize","operationId":"tokenize_v1_tokenize_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/TokenizeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenizeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/detokenize":{"post":{"tags":["Tokenizer"],"summary":"Detokenize","operationId":"detokenize_v1_detokenize_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/DetokenizeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetokenizeOut"}}}},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/videos":{"post":{"tags":["Videos"],"summary":"Create Video Generation","operationId":"create_video_generation_v1_videos_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/VideoGenerationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/videos":{"post":{"tags":["Videos"],"summary":"Create Video Generation","operationId":"create_video_generation_v1_openai_videos_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/VideoGenerationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/{video_id}":{"get":{"tags":["Videos"],"summary":"Get Video Generation","operationId":"get_video_generation_v1_videos__video_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/openai/videos/{video_id}":{"get":{"tags":["Videos"],"summary":"Get Video Generation","operationId":"get_video_generation_v1_openai_videos__video_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/{video_id}/content":{"get":{"tags":["Videos"],"summary":"Get Video Content","operationId":"get_video_content_v1_videos__video_id__content_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"variant","in":"query","required":false,"schema":{"type":"string","default":"video","title":"Variant"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/videos/{video_id}/content":{"get":{"tags":["Videos"],"summary":"Get Video Content","operationId":"get_video_content_v1_openai_videos__video_id__content_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"variant","in":"query","required":false,"schema":{"type":"string","default":"video","title":"Variant"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"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/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"}},{"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/OpenAIEmbeddingsIn"}}}},"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","security":[{"HTTPBearer":[]}],"parameters":[{"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"}},{"name":"x-deepinfra-service-tier","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Deepinfra-Service-Tier"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/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","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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"}}}}}}},"/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"}}}}}}},"/google/login":{"get":{"tags":["Authentication"],"summary":"Google Login","description":"Initiate Google SSO login flow. Callback is /google/callback","operationId":"google_login_google_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"}}}}}}},"/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/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":10000,"title":"Limit"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/files/{file_id}":{"get":{"tags":["Files & Batches"],"summary":"Get File","operationId":"get_file_v1_files__file_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIFile"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Files & Batches"],"summary":"Delete File","operationId":"delete_file_v1_files__file_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/{file_id}/content":{"get":{"tags":["Files & Batches"],"summary":"Get File Content","operationId":"get_file_content_v1_files__file_id__content_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"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":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"}},{"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/OpenAIBatchesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatchesOut"}}}},"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatchesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batches/{batch_id}/cancel":{"post":{"tags":["Files & Batches"],"summary":"Cancel Openai Batch","operationId":"cancel_openai_batch_v1_batches__batch_id__cancel_post","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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIBatchesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/{deploy_id}/rebalance":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Rebalance","description":"Start a GPU pool rebalance: move GPUs from this deployment onto another\ndeployment you own, one instance at a time and without downtime. Moving all\ninstances stops this deployment; start it again later to resume it.","operationId":"deploy_rebalance_deploy__deploy_id__rebalance_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"}},{"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/RebalanceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebalanceOut"}}}},"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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"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":["Dedicated Models"],"summary":"Deploy Rebalance Status","description":"Status of GPU pool rebalances touching this deployment. A just-started\nrebalance can take a moment to appear. A finished or cancelled rebalance\nleaves both deployments' min/max instances fixed at the final counts; edit\nthem to resume autoscaling.","operationId":"deploy_rebalance_status_deploy__deploy_id__rebalance_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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebalanceStatusOut"}}}},"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"}}}}}}},"/deploy/{deploy_id}/rebalance/cancel":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Rebalance Cancel","description":"Stop an in-flight GPU pool rebalance; instances already moved stay, and\nboth deployments keep min/max instances fixed at their current counts.","operationId":"deploy_rebalance_cancel_deploy__deploy_id__rebalance_cancel_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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RebalanceCancelIn"},{"type":"null"}],"title":"Cancel"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebalanceCancelOut"}}}},"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"},"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":{"post":{"tags":["Agents"],"summary":"Create Instance","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"}},{"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/AgentCreateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateOut"}}}},"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":"List Instances","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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentInstanceOut"},"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":"Get 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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCatalogOut"}}}},"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":"Get Instance","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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInstanceOut"}}}},"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":"Rename Instance","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"}},{"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/AgentUpdateIn"}}}},"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":"Delete Instance","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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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":"Create Dashboard 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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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":"Stop Instance","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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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":"Start Instance","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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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":"Update Instance 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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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":"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentBackupOut"},"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":"Create 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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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":"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"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/sandboxes":{"post":{"tags":["Sandboxes"],"summary":"Create Sandbox","description":"Create a new sandbox instance with the given plan and settings. The sandbox starts in CREATING state and transitions to RUNNING asynchronously.","operationId":"sandbox_create_v1_sandboxes_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/SandboxCreateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxCreateOut"}}}},"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"},"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":["Sandboxes"],"summary":"List Sandboxes","operationId":"sandbox_list_v1_sandboxes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SandboxOut"},"title":"Response Sandbox List V1 Sandboxes 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/sandboxes/catalog":{"get":{"tags":["Sandboxes"],"summary":"List Sandbox Plans","description":"Returns all available sandbox plans with their resource specs and pricing.","operationId":"sandbox_catalog_v1_sandboxes_catalog_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SandboxPlanOut"},"title":"Response Sandbox Catalog V1 Sandboxes Catalog 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/sandboxes/{sandbox_id}":{"get":{"tags":["Sandboxes"],"summary":"Get Sandbox","operationId":"sandbox_get_v1_sandboxes__sandbox_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxOut"}}}},"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":["Sandboxes"],"summary":"Delete Sandbox","operationId":"sandbox_delete_v1_sandboxes__sandbox_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/sandboxes/{sandbox_id}/stop":{"post":{"tags":["Sandboxes"],"summary":"Stop Sandbox","operationId":"sandbox_stop_v1_sandboxes__sandbox_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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/sandboxes/{sandbox_id}/start":{"post":{"tags":["Sandboxes"],"summary":"Start Sandbox","operationId":"sandbox_start_v1_sandboxes__sandbox_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-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"},"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"}}}}}}},"/v1/sandboxes/{sandbox_id}/exec":{"post":{"tags":["Sandboxes"],"summary":"Exec Command","description":"Run a command in the sandbox. Streams NDJSON lines (application/x-ndjson): {\"stdout\": ...}/{\"stderr\": ...} chunks followed by exactly one terminal {\"returncode\": N} or {\"error\": msg} line.","operationId":"sandbox_exec_v1_sandboxes__sandbox_id__exec_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/SandboxExecIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sandboxes/{sandbox_id}/fs/content":{"put":{"tags":["Sandboxes"],"summary":"Write File","description":"Write the raw request body (application/octet-stream, max 100 MiB) to an absolute path inside the sandbox.","operationId":"sandbox_fs_write_v1_sandboxes__sandbox_id__fs_content_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"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"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Request Entity Too Large"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Sandboxes"],"summary":"Read File","description":"Read a file from an absolute path inside the sandbox; returns raw bytes (application/octet-stream).","operationId":"sandbox_fs_read_v1_sandboxes__sandbox_id__fs_content_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sandbox_id","in":"path","required":true,"schema":{"type":"string","title":"Sandbox Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"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"},"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 Checkout Session URL to complete payment. Non-null when no saved payment method is on file."}},"type":"object","title":"AddFundsOut"},"BillingAddressOut":{"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":"BillingAddressOut"},"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},"billing_address_info":{"anyOf":[{"$ref":"#/components/schemas/BillingAddressOut"},{"type":"null"}]},"payment_method":{"type":"boolean","title":"Payment Method","default":false},"payment_method_info":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodOut"},{"type":"null"}]},"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"},"intermediate_invoicing_threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Intermediate Invoicing Threshold"}},"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"},"due_date":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Due Date"},"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},"contract":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract","description":"bare-metal contract description, shown like on invoices"}},"type":"object","required":["provider","model_name","task"],"title":"ModelMeta"},"PaymentMethodBank":{"properties":{"bank_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bank Name"},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4"}},"type":"object","title":"PaymentMethodBank"},"PaymentMethodCard":{"properties":{"brand":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand"},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4"},"wallet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet"}},"type":"object","title":"PaymentMethodCard"},"PaymentMethodCashApp":{"properties":{"cashtag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cashtag"}},"type":"object","title":"PaymentMethodCashApp"},"PaymentMethodOut":{"properties":{"type":{"type":"string","title":"Type"},"card":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodCard"},{"type":"null"}]},"us_bank_account":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodBank"},{"type":"null"}]},"cashapp":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodCashApp"},{"type":"null"}]}},"type":"object","required":["type"],"title":"PaymentMethodOut"},"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"},"AgentBackupOut":{"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":"AgentBackupOut"},"AgentCatalogOut":{"additionalProperties":{"$ref":"#/components/schemas/AgentTypeMetaOut"},"type":"object","title":"AgentCatalogOut","description":"Per-agent-type catalog: keyed by agent_type_id, each entry carries the\ncurrent version and the plans available for that type."},"AgentCreateIn":{"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":"AgentCreateIn"},"AgentCreateOut":{"properties":{"instance_id":{"type":"string","title":"Instance Id","description":"Instance ID"}},"type":"object","required":["instance_id"],"title":"AgentCreateOut"},"AgentInstanceOut":{"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"},"ssh_user":{"type":"string","title":"Ssh User","description":"POSIX user the agent runs as inside the VM; also the SSH login user."},"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","ssh_user","plan_id"],"title":"AgentInstanceOut"},"AgentInstanceState":{"type":"string","enum":["creating","starting","running","stopping","stopped","failed","deleted"],"title":"AgentInstanceState"},"AgentPlanOut":{"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"},"monthly_egress_gb":{"type":"integer","title":"Monthly Egress Gb","description":"Included monthly egress allowance in GB"}},"type":"object","required":["id","vcpu","ram_gb","price_per_hour","monthly_egress_gb"],"title":"AgentPlanOut"},"AgentTypeMetaOut":{"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/AgentPlanOut"},"type":"array","title":"Plans","description":"Plans available for this agent type"}},"type":"object","required":["pretty_name","version","has_dashboard","plans"],"title":"AgentTypeMetaOut"},"AgentUpdateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Instance name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"AgentUpdateIn"},"AnthropicMessagesIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'."},"fail_fast":{"type":"boolean","title":"Fail Fast","description":"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.","default":false},"models":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1},{"type":"null"}],"title":"Models","description":"Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence."},"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"}]},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key"}},"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":{"type":{"anyOf":[{"type":"string","enum":["enabled","disabled","adaptive"]},{"type":"null"}],"title":"Type"},"budget_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Budget Tokens"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"AnthropicThinkingConfig","description":"Anthropic `thinking` config: {type: enabled|disabled|adaptive, budget_tokens}.\n\n`enabled` is a legacy pre-spec field this endpoint used to accept; it only\napplies when `type` is absent."},"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"},"BatchErrorData":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code","description":"An error code identifying the error type."},"line":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Line","description":"The line number of the input file where the error occurred."},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"A human-readable message describing the error."},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param","description":"The name of the parameter that caused the error."}},"type":"object","title":"BatchErrorData"},"BatchErrors":{"properties":{"object":{"type":"string","title":"Object","description":"The object type, which is always list.","default":"list"},"data":{"items":{"$ref":"#/components/schemas/BatchErrorData"},"type":"array","title":"Data","description":"List of error objects."}},"type":"object","title":"BatchErrors"},"BatchInputTokensDetails":{"properties":{"cached_tokens":{"type":"integer","title":"Cached Tokens","default":0}},"type":"object","title":"BatchInputTokensDetails"},"BatchOutputExpiresAfter":{"properties":{"anchor":{"type":"string","const":"created_at","title":"Anchor","description":"The anchor timestamp after which the expiration policy applies. Currently only created_at is supported.","default":"created_at"},"seconds":{"type":"integer","maximum":2592000.0,"minimum":3600.0,"title":"Seconds","description":"The number of seconds after the anchor time that the output and error files will expire. Must be between 3600 (1 hour) and 2592000 (30 days).","default":2592000}},"type":"object","title":"BatchOutputExpiresAfter"},"BatchOutputTokensDetails":{"properties":{"reasoning_tokens":{"type":"integer","title":"Reasoning Tokens","default":0}},"type":"object","title":"BatchOutputTokensDetails"},"BatchRequestCounts":{"properties":{"total":{"type":"integer","title":"Total","description":"Total number of requests in the batch.","default":0},"completed":{"type":"integer","title":"Completed","description":"Number of requests that completed successfully.","default":0},"failed":{"type":"integer","title":"Failed","description":"Number of requests that failed.","default":0}},"type":"object","title":"BatchRequestCounts"},"BatchUsage":{"properties":{"input_tokens":{"type":"integer","title":"Input Tokens","default":0},"input_tokens_details":{"$ref":"#/components/schemas/BatchInputTokensDetails"},"output_tokens":{"type":"integer","title":"Output Tokens","default":0},"output_tokens_details":{"$ref":"#/components/schemas/BatchOutputTokensDetails"},"total_tokens":{"type":"integer","title":"Total Tokens","default":0}},"type":"object","title":"BatchUsage"},"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"},"service_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Tier"}},"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},"service_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Tier"}},"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"},"prompt_cache_breakpoint":{"anyOf":[{"$ref":"#/components/schemas/PromptCacheBreakpoint"},{"type":"null"}],"description":"Marks the end of the prefix that prompt_cache_options retention applies to."}},"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":["none","minimal","low","medium","high","xhigh","max"]},{"type":"null"}],"title":"Effort","description":"Constrains effort on reasoning for reasoning models. Set to none to disable reasoning entirely if the model supports it."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Enable or disable reasoning with default parameters."}},"type":"object","title":"ChatReasoningSettings"},"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"},"DeployArgsHistoryOut":{"properties":{"entry_id":{"type":"string","title":"Entry Id","description":"Identifier of this past config; pass it to POST /deploy/{deploy_id}/config/history/{entry_id}/restore."},"retired_at":{"type":"string","title":"Retired At","description":"When this config was retired.","examples":["2021-08-27T17:19:21+00:00"]},"standard_args":{"additionalProperties":true,"type":"object","description":"Engine tuning knobs of this config."},"extra_args":{"items":{"type":"string"},"type":"array","title":"Extra Args","description":"Extra engine-specific command-line args of this config (custom-weight deploys only)."}},"type":"object","required":["entry_id","retired_at","standard_args"],"title":"DeployArgsHistoryOut"},"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},"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"},"standard_args":{"anyOf":[{"$ref":"#/components/schemas/StandardArgs"},{"type":"null"}],"description":"Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. Unset knobs use the model/engine defaults."},"preset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preset Id","description":"Apply a stored preset or vLLM recipe by id. A non-empty standard_args or extra_args in this request replaces the preset's whole matching field."}},"type":"object","required":["model_name","gpu"],"title":"DeployLLMIn"},"DeployLLMUpdateIn":{"properties":{"settings":{"anyOf":[{"$ref":"#/components/schemas/ScaleSettings"},{"type":"null"}]},"standard_args":{"anyOf":[{"$ref":"#/components/schemas/StandardArgs"},{"type":"null"}],"description":"Engine tuning knobs. Replaces the whole set; omitted knobs are cleared."},"extra_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Args","description":"Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared."}},"type":"object","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"},"DeployRollout":{"properties":{"up_to_date":{"type":"integer","title":"Up To Date","description":"Instances serving the current config."},"outdated":{"type":"integer","title":"Outdated","description":"Instances still serving a previous config."},"booting":{"type":"integer","title":"Booting","description":"Instances starting up."}},"type":"object","required":["up_to_date","outdated","booting"],"title":"DeployRollout"},"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"},"standard_args":{"properties":{"max_context_size":{"anyOf":[{"type":"integer","maximum":10000000.0,"minimum":1.0},{"type":"null"}],"title":"Max Context Size","description":"Maximum total sequence length (prompt + generation)."},"max_concurrent_requests":{"anyOf":[{"type":"integer","maximum":1024.0,"minimum":1.0},{"type":"null"}],"title":"Max Concurrent Requests","description":"Max number of requests served concurrently."},"gpu_memory_fraction":{"anyOf":[{"type":"number","maximum":0.97,"minimum":0.5},{"type":"null"}],"title":"Gpu Memory Fraction","description":"Fraction of GPU memory the engine may use for weights + KV cache."},"max_prefill_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":512.0},{"type":"null"}],"title":"Max Prefill Tokens","description":"Max tokens processed per prefill/engine step (chunked prefill size)."},"kv_cache_dtype":{"anyOf":[{"type":"string","enum":["auto","fp8"]},{"type":"null"}],"title":"Kv Cache Dtype","description":"KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss."},"enable_prefix_caching":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Prefix Caching","description":"Reuse KV cache for shared prompt prefixes."},"quantization":{"anyOf":[{"type":"string","enum":["fp8","awq","gptq","awq_marlin","gptq_marlin","compressed-tensors","bitsandbytes"]},{"type":"null"}],"title":"Quantization","description":"On-the-fly weight quantization method."}},"additionalProperties":false,"type":"object","title":"StandardArgs","description":"Current engine tuning knobs"},"extra_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Args","description":"Current extra engine-specific command-line args (custom-weight deploys only)"},"update_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Update Error","description":"If the last config update was auto-reverted after an engine crash-loop, the error that caused it (status stays 'running')"},"rollout":{"anyOf":[{"$ref":"#/components/schemas/DeployRollout"},{"type":"null"}],"description":"Per-instance rollout progress of the current config"}},"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"},"DetokenizeIn":{"properties":{"model":{"type":"string","title":"Model","description":"model name","examples":["my-org/my-dedicated-llm"]},"tokens":{"items":{"type":"integer"},"type":"array","title":"Tokens","description":"token ids to detokenize"}},"additionalProperties":true,"type":"object","required":["model"],"title":"DetokenizeIn"},"DetokenizeOut":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"detokenized text"}},"type":"object","required":["prompt"],"title":"DetokenizeOut"},"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"},"FunctionTool":{"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":"FunctionTool"},"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"},"GpuPoolOut":{"properties":{"max_limits":{"additionalProperties":{"type":"integer"},"propertyNames":{"$ref":"#/components/schemas/DeployGPUs"},"type":"object","title":"Max Limits","description":"Effective GPU max per type (pool, 0 if unset)"},"min_limits":{"additionalProperties":{"type":"integer"},"propertyNames":{"$ref":"#/components/schemas/DeployGPUs"},"type":"object","title":"Min Limits","description":"Effective GPU min per type (pool, 0 if unset)"},"pending_max_requests":{"anyOf":[{"additionalProperties":{"type":"integer"},"propertyNames":{"$ref":"#/components/schemas/DeployGPUs"},"type":"object"},{"type":"null"}],"title":"Pending Max Requests","description":"Pending requested max per type"},"pending_min_requests":{"anyOf":[{"additionalProperties":{"type":"integer"},"propertyNames":{"$ref":"#/components/schemas/DeployGPUs"},"type":"object"},{"type":"null"}],"title":"Pending Min Requests","description":"Pending requested min per type"}},"type":"object","title":"GpuPoolOut"},"GpuPoolRequestIn":{"properties":{"reason":{"type":"string","maxLength":2048,"title":"Reason"},"requested_min":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Requested Min"},"requested_max":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Requested Max"}},"type":"object","required":["reason"],"title":"GpuPoolRequestIn"},"GpuTypesOut":{"properties":{"gpu_types":{"items":{"$ref":"#/components/schemas/DeployGPUs"},"type":"array","title":"Gpu Types","description":"GPU types to show in the pools UI, in display order. A guide, not a limit: a pool may hold types outside this list."}},"type":"object","required":["gpu_types"],"title":"GpuTypesOut"},"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","text-to-music","rent-container","bare-metal","cluster","reranker","openclaw","hermes","world-model","sandbox","commitment"],"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"},"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount"}},"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},"can_access_sandboxes":{"type":"boolean","title":"Can Access Sandboxes","description":"Whether the user may use the sandboxes feature (available to all users)","default":true},"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"}]},"google_linked":{"type":"boolean","title":"Google Linked","description":"Whether a Google account is linked","default":false},"show_signup_form":{"type":"boolean","title":"Show Signup Form","description":"Frontend should route the user into the post-signup account-details form","default":false},"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)"},"sample_output_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample Output Url","description":"dataurl or regular url to a sample of this model's output, shown on the model page before the first run (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"},"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount"},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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"},"rate_per_service_tier_priority":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Service Tier Priority"},"rate_per_service_tier_flex":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Service Tier Flex"},"rate_per_explicit_cache_write_token":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Rate Per Explicit Cache Write Token"},"explicit_cache_granularity_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Explicit Cache Granularity Tokens"}},"type":"object","required":["cents_per_input_token","cents_per_output_token"],"title":"ModelPricingTokens"},"ModelPricingUptime":{"properties":{"discount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Discount","description":"Promotional discount; you are charged price * (1 - discount)","examples":[0.2]},"discount_ends_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discount Ends At","description":"Unix timestamp (seconds) when the discount ends, null when it has no scheduled end","examples":[1786000000]},"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"}},"additionalProperties":false,"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"},"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","/v1/embeddings"],"title":"Endpoint","description":"The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions, /v1/embeddings 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":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional metadata to be stored with the batch."},"output_expires_after":{"anyOf":[{"$ref":"#/components/schemas/BatchOutputExpiresAfter"},{"type":"null"}],"description":"The expiration policy for the output and/or error file generated for the batch."}},"type":"object","required":["input_file_id","endpoint","completion_window"],"title":"OpenAIBatchesIn"},"OpenAIBatchesOut":{"properties":{"id":{"type":"string","title":"Id","description":"The batch ID."},"object":{"type":"string","const":"batch","title":"Object","description":"The object type, which is always batch.","default":"batch"},"endpoint":{"type":"string","title":"Endpoint","description":"The API endpoint used for the batch."},"errors":{"anyOf":[{"$ref":"#/components/schemas/BatchErrors"},{"type":"null"}],"description":"Errors that occurred during the batch."},"input_file_id":{"type":"string","title":"Input File Id","description":"The ID of the input file for the batch."},"completion_window":{"type":"string","title":"Completion Window","description":"The time frame within which the batch should be processed."},"status":{"type":"string","title":"Status","description":"The current status of the batch."},"output_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output File Id","description":"The ID of the output file."},"error_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error File Id","description":"The ID of the error file."},"created_at":{"type":"integer","title":"Created At","description":"The Unix timestamp of when the batch was created."},"in_progress_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"In Progress At","description":"The Unix timestamp of when the batch started processing."},"expires_at":{"type":"integer","title":"Expires At","description":"The Unix timestamp of when the batch will expire."},"finalizing_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Finalizing At","description":"The Unix timestamp of when the batch started finalizing."},"completed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completed At","description":"The Unix timestamp of when the batch completed."},"failed_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed At","description":"The Unix timestamp of when the batch failed."},"expired_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expired At","description":"The Unix timestamp of when the batch expired."},"cancelling_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelling At","description":"The Unix timestamp of when the batch started cancelling."},"cancelled_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancelled At","description":"The Unix timestamp of when the batch was cancelled."},"request_counts":{"anyOf":[{"$ref":"#/components/schemas/BatchRequestCounts"},{"type":"null"}],"description":"Request counts for the batch."},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Metadata associated with the batch."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"The model used for the batch."},"usage":{"anyOf":[{"$ref":"#/components/schemas/BatchUsage"},{"type":"null"}],"description":"Token usage accumulated for the batch."}},"type":"object","required":["id","endpoint","input_file_id","completion_window","status","created_at","expires_at"],"title":"OpenAIBatchesOut"},"OpenAIChatCompletionsIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'."},"fail_fast":{"type":"boolean","title":"Fail Fast","description":"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.","default":false},"models":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1},{"type":"null"}],"title":"Models","description":"Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence."},"model":{"type":"string","title":"Model","description":"model name","examples":["meta-llama/Llama-2-70b-chat-hf"]},"messages":{"items":{"oneOf":[{"$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 65536, 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/FunctionTool"},"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","enum":["none","auto","required"]},{"$ref":"#/components/schemas/FunctionTool"},{"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":["none","minimal","low","medium","high","xhigh","max"]},{"type":"null"}],"title":"Reasoning Effort","description":"Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. 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."},"prompt_cache_options":{"anyOf":[{"$ref":"#/components/schemas/PromptCacheOptions"},{"type":"null"}],"description":"Prompt cache options for this request's prefix, e.g. {\"ttl\": \"1h\"}."},"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."},"ignore_eos":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ignore Eos","description":"Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed."}},"type":"object","required":["model","messages"],"title":"OpenAIChatCompletionsIn"},"OpenAICompletionsIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'."},"fail_fast":{"type":"boolean","title":"Fail Fast","description":"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.","default":false},"models":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":4,"minItems":1},{"type":"null"}],"title":"Models","description":"Ordered list of up to 4 fallback models. The request is attempted on each model in order: when a model rejects it for lack of capacity (HTTP 429 model-busy / flex no-capacity), the next model is tried server-side. The first model that accepts serves the request; the response's model field and billing reflect that model, at that model's pricing. Models before the last are attempted without queueing (as if fail_fast were set); the last model honors the request's own fail_fast value. When models is set, the model field is ignored. Entries must be plain model names (no deploy_id:, custom_hostport, or :revision specifiers); duplicate entries are ignored, keeping the first occurrence."},"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 65536, 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."},"prompt_cache_options":{"anyOf":[{"$ref":"#/components/schemas/PromptCacheOptions"},{"type":"null"}],"description":"Prompt cache options for this request's prefix, e.g. {\"ttl\": \"1h\"}."},"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,...')."},"ignore_eos":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ignore Eos","description":"Keep generating until max_tokens instead of stopping at the end-of-sequence token. Only honoured on models tagged with the allow_ignore_eos feature flag; ignored otherwise. Intended for benchmarking, where a fixed output length is needed."}},"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. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'."},"fail_fast":{"type":"boolean","title":"Fail Fast","description":"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.","default":false},"model":{"type":"string","title":"Model","description":"model name","examples":["thenlper/gte-large"]},"input":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"type":"string"},{"items":{"oneOf":[{"$ref":"#/components/schemas/ChatCompletionContentPartText"},{"$ref":"#/components/schemas/ChatCompletionContentPartImage"}],"discriminator":{"propertyName":"type","mapping":{"image_url":"#/components/schemas/ChatCompletionContentPartImage","text":"#/components/schemas/ChatCompletionContentPartText"}}},"type":"array"}]},"type":"array"}],"maxLength":1024,"title":"Input","description":"text or multimodal content to embed. Each item is either a string, or a list of content parts ({\"type\":\"text\"} / {\"type\":\"image_url\"}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2.","examples":[["I like chocolate"]],"soft_required":true},"input_type":{"anyOf":[{"type":"string","enum":["query","passage","document"]},{"type":"null"}],"title":"Input Type","description":"Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models."},"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"},"OpenAIFile":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","const":"file","title":"Object"},"created_at":{"type":"integer","title":"Created At"},"filename":{"type":"string","title":"Filename"},"bytes":{"type":"integer","title":"Bytes"},"purpose":{"type":"string","enum":["batch","batch_output","fine-tune"],"title":"Purpose"},"expires_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["id","object","created_at","filename","bytes","purpose"],"title":"OpenAIFile"},"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. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'."},"fail_fast":{"type":"boolean","title":"Fail Fast","description":"If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.","default":false},"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"},"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"},"OpenRouterModelsOut":{"properties":{"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data","description":"List of available models"}},"type":"object","required":["data"],"title":"OpenRouterModelsOut"},"PresetConfigOut":{"properties":{"id":{"type":"string","title":"Id","description":"Preset id."},"source":{"type":"string","title":"Source","description":"Config source.","default":"deepinfra"},"engine":{"type":"string","title":"Engine","description":"Inference engine.","default":"vllm"},"gpu_configs":{"items":{"type":"string"},"type":"array","title":"Gpu Configs","description":"Allowed Nx configs."},"standard_args":{"properties":{"max_context_size":{"anyOf":[{"type":"integer","maximum":10000000.0,"minimum":1.0},{"type":"null"}],"title":"Max Context Size","description":"Maximum total sequence length (prompt + generation)."},"max_concurrent_requests":{"anyOf":[{"type":"integer","maximum":1024.0,"minimum":1.0},{"type":"null"}],"title":"Max Concurrent Requests","description":"Max number of requests served concurrently."},"gpu_memory_fraction":{"anyOf":[{"type":"number","maximum":0.97,"minimum":0.5},{"type":"null"}],"title":"Gpu Memory Fraction","description":"Fraction of GPU memory the engine may use for weights + KV cache."},"max_prefill_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":512.0},{"type":"null"}],"title":"Max Prefill Tokens","description":"Max tokens processed per prefill/engine step (chunked prefill size)."},"kv_cache_dtype":{"anyOf":[{"type":"string","enum":["auto","fp8"]},{"type":"null"}],"title":"Kv Cache Dtype","description":"KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss."},"enable_prefix_caching":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Prefix Caching","description":"Reuse KV cache for shared prompt prefixes."},"quantization":{"anyOf":[{"type":"string","enum":["fp8","awq","gptq","awq_marlin","gptq_marlin","compressed-tensors","bitsandbytes"]},{"type":"null"}],"title":"Quantization","description":"On-the-fly weight quantization method."}},"additionalProperties":false,"type":"object","title":"StandardArgs","description":"Engine tuning knobs."},"extra_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Args","description":"Raw engine flags; vLLM recipes only."},"label":{"type":"string","title":"Label","description":"Short display name (e.g. \"Throughput-optimized\").","default":""}},"type":"object","required":["id","gpu_configs"],"title":"PresetConfigOut","description":"One preset deploy config for an HF model on specific hardware."},"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"},"PromptCacheBreakpoint":{"properties":{"mode":{"anyOf":[{"type":"string","const":"explicit"},{"type":"null"}],"title":"Mode","description":"Breakpoint mode; 'explicit' bounds cache retention to the prompt prefix ending at this content part."}},"type":"object","title":"PromptCacheBreakpoint"},"PromptCacheOptions":{"properties":{"mode":{"anyOf":[{"type":"string","enum":["explicit","implicit"]},{"type":"null"}],"title":"Mode","description":"Prompt caching mode; 'explicit' requests explicit caching."},"ttl":{"anyOf":[{"type":"string","enum":["5m","1h"]},{"type":"null"}],"title":"Ttl","description":"Requested cache retention for this request's prefix."}},"type":"object","title":"PromptCacheOptions"},"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"},"RebalanceCancelIn":{"properties":{"replace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replace Id","description":"Rebalance to cancel; defaults to the active one."}},"type":"object","title":"RebalanceCancelIn"},"RebalanceCancelOut":{"properties":{"replace_id":{"type":"string","title":"Replace Id","description":"Id of the cancelled rebalance."},"placed":{"type":"integer","title":"Placed","description":"Target instances delivered before the cancel."},"count":{"type":"integer","title":"Count","description":"Target instances requested."}},"type":"object","required":["replace_id","placed","count"],"title":"RebalanceCancelOut"},"RebalanceIn":{"properties":{"target_deploy_id":{"type":"string","title":"Target Deploy Id","description":"Deployment to grow using GPUs freed from this one."},"count":{"type":"integer","maximum":2147483647.0,"minimum":1.0,"title":"Count","description":"Number of target instances to create."},"dry_run":{"type":"boolean","title":"Dry Run","description":"Validate and preview without moving anything.","default":false}},"type":"object","required":["target_deploy_id","count"],"title":"RebalanceIn"},"RebalanceOut":{"properties":{"replace_id":{"type":"string","title":"Replace Id","description":"Id of the started rebalance; empty on a dry run.","default":""},"gpu":{"type":"string","title":"Gpu","description":"GPU type being rebalanced."},"source_instances":{"type":"integer","title":"Source Instances","description":"Source instances now."},"source_instances_after":{"type":"integer","title":"Source Instances After","description":"Source instances once the rebalance completes."},"target_instances":{"type":"integer","title":"Target Instances","description":"Target instances now."},"target_instances_after":{"type":"integer","title":"Target Instances After","description":"Target instances once the rebalance completes."}},"type":"object","required":["gpu","source_instances","source_instances_after","target_instances","target_instances_after"],"title":"RebalanceOut"},"RebalanceStatus":{"properties":{"replace_id":{"type":"string","title":"Replace Id","description":"Id of the rebalance."},"direction":{"type":"string","enum":["outgoing","incoming"],"title":"Direction","description":"Whether this deployment is the source or the target."},"status":{"type":"string","title":"Status","description":"Rebalance status.","examples":["active","done","failed","cancelled"]},"placed":{"type":"integer","title":"Placed","description":"Target instances delivered so far."},"count":{"type":"integer","title":"Count","description":"Target instances requested."},"source_deploy_id":{"type":"string","title":"Source Deploy Id","description":"Deploy Id of the source; empty if not yours.","default":""},"target_deploy_id":{"type":"string","title":"Target Deploy Id","description":"Deploy Id of the target; empty if not yours.","default":""},"source_model_name":{"type":"string","title":"Source Model Name","description":"Model name of the source; empty if not yours.","default":""},"target_model_name":{"type":"string","title":"Target Model Name","description":"Model name of the target; empty if not yours.","default":""},"error":{"type":"string","title":"Error","description":"Failure reason, if any.","default":""},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"When the rebalance was requested."},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At","description":"When the rebalance finished."}},"type":"object","required":["replace_id","direction","status","placed","count","created_at"],"title":"RebalanceStatus"},"RebalanceStatusOut":{"properties":{"active":{"anyOf":[{"$ref":"#/components/schemas/RebalanceStatus"},{"type":"null"}],"description":"The in-flight rebalance touching this deployment."},"recent":{"items":{"$ref":"#/components/schemas/RebalanceStatus"},"type":"array","title":"Recent","description":"Finished rebalances, newest first."}},"type":"object","title":"RebalanceStatusOut"},"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"},"SandboxCreateIn":{"properties":{"plan":{"type":"string","title":"Plan","default":""},"tags":{"additionalProperties":{"type":"string"},"type":"object","title":"Tags"},"timeout_seconds":{"type":"integer","title":"Timeout Seconds","default":0}},"type":"object","title":"SandboxCreateIn"},"SandboxCreateOut":{"properties":{"sandbox_id":{"type":"string","title":"Sandbox Id"}},"type":"object","required":["sandbox_id"],"title":"SandboxCreateOut"},"SandboxExecIn":{"properties":{"command":{"items":{"type":"string"},"type":"array","title":"Command"},"timeout_seconds":{"type":"integer","title":"Timeout Seconds","description":"Seconds to allow the command to run before it's killed. 0 uses the server default (60s). Capped at 1800s (30 minutes).","default":0}},"type":"object","required":["command"],"title":"SandboxExecIn"},"SandboxOut":{"properties":{"sandbox_id":{"type":"string","title":"Sandbox Id"},"plan":{"type":"string","title":"Plan"},"image":{"type":"string","title":"Image"},"state":{"type":"string","title":"State"},"tags":{"additionalProperties":{"type":"string"},"type":"object","title":"Tags"},"created_at":{"type":"integer","title":"Created At"},"provider":{"type":"string","title":"Provider"},"fail_reason":{"type":"string","title":"Fail Reason","default":""}},"type":"object","required":["sandbox_id","plan","image","state","tags","created_at","provider"],"title":"SandboxOut"},"SandboxPlanOut":{"properties":{"id":{"type":"string","title":"Id"},"vcpu":{"type":"integer","title":"Vcpu"},"ram_gb":{"type":"integer","title":"Ram Gb"},"disk_gb":{"type":"integer","title":"Disk Gb"},"price_per_hour":{"type":"number","title":"Price Per Hour"}},"type":"object","required":["id","vcpu","ram_gb","disk_gb","price_per_hour"],"title":"SandboxPlanOut"},"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","flex"],"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"},"StandardArgs":{"properties":{"max_context_size":{"anyOf":[{"type":"integer","maximum":10000000.0,"minimum":1.0},{"type":"null"}],"title":"Max Context Size","description":"Maximum total sequence length (prompt + generation)."},"max_concurrent_requests":{"anyOf":[{"type":"integer","maximum":1024.0,"minimum":1.0},{"type":"null"}],"title":"Max Concurrent Requests","description":"Max number of requests served concurrently."},"gpu_memory_fraction":{"anyOf":[{"type":"number","maximum":0.97,"minimum":0.5},{"type":"null"}],"title":"Gpu Memory Fraction","description":"Fraction of GPU memory the engine may use for weights + KV cache."},"max_prefill_tokens":{"anyOf":[{"type":"integer","maximum":131072.0,"minimum":512.0},{"type":"null"}],"title":"Max Prefill Tokens","description":"Max tokens processed per prefill/engine step (chunked prefill size)."},"kv_cache_dtype":{"anyOf":[{"type":"string","enum":["auto","fp8"]},{"type":"null"}],"title":"Kv Cache Dtype","description":"KV cache precision. fp8 ~doubles KV capacity at <1% accuracy loss."},"enable_prefix_caching":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Prefix Caching","description":"Reuse KV cache for shared prompt prefixes."},"quantization":{"anyOf":[{"type":"string","enum":["fp8","awq","gptq","awq_marlin","gptq_marlin","compressed-tensors","bitsandbytes"]},{"type":"null"}],"title":"Quantization","description":"On-the-fly weight quantization method."}},"additionalProperties":false,"type":"object","title":"StandardArgs","description":"The standard-argument allowlist. Construct from a raw ``dict[str, str]``\nvia :meth:`from_raw`; render to engine flags via :func:`standard_parts`."},"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"},"TokenizeIn":{"properties":{"model":{"type":"string","title":"Model","description":"model name","examples":["my-org/my-dedicated-llm"]},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt","description":"text to tokenize (completion form)"},"messages":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Messages","description":"chat messages to tokenize (chat form)"},"return_token_strs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Return Token Strs","description":"also return the per-token strings (vLLM)"}},"additionalProperties":true,"type":"object","required":["model"],"title":"TokenizeIn"},"TokenizeOut":{"properties":{"count":{"type":"integer","title":"Count","description":"number of tokens"},"max_model_len":{"type":"integer","title":"Max Model Len","description":"the model's maximum context length"},"tokens":{"items":{"type":"integer"},"type":"array","title":"Tokens","description":"token ids"},"token_strs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Token Strs","description":"per-token strings, if requested (vLLM)"}},"type":"object","required":["count","max_model_len","tokens"],"title":"TokenizeOut"},"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"},"VideoGenerationIn":{"properties":{"model":{"type":"string","title":"Model"},"prompt":{"type":"string","title":"Prompt"},"negative_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Negative Prompt"},"aspect_ratio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aspect Ratio"},"size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Size"},"seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Style"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"First-frame image for image-to-video (i2v): an http(s) URL or a data: URI. Omit for text-to-video."}},"type":"object","required":["model","prompt"],"title":"VideoGenerationIn"},"VideoGenerationOut":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"video.generation.job"},"created_at":{"type":"integer","title":"Created At"},"status":{"type":"string","title":"Status"},"model":{"type":"string","title":"Model"},"data":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Data"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","created_at","status","model"],"title":"VideoGenerationOut"},"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"},"WebSearchTool":{"properties":{"type":{"type":"string","const":"web_search","title":"Type"},"max_results":{"type":"integer","minimum":1.0,"title":"Max Results","description":"Maximum results returned per search call. Values above 20 are clamped.","default":5},"include_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Include Domains","description":"Only results from these domains are kept. Entries are bare domains with an optional path prefix; a bare domain covers its subdomains. Wildcards are not supported. Mutually exclusive with exclude_domains."},"exclude_domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Domains","description":"Results from these domains are dropped. Entries are bare domains with an optional path prefix; a bare domain covers its subdomains. Wildcards are not supported. Mutually exclusive with include_domains."},"search_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Prompt","description":"Steering text for how retrieved results are framed when injected into the model's context."}},"additionalProperties":false,"type":"object","required":["type"],"title":"WebSearchTool"}},"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":"Sandboxes","description":"Create and manage isolated sandbox environments."},{"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