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/AccountAccountGpuLimitCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountAccountGpuLimitCommandApiCommand.g.cs new file mode 100644 index 00000000..aeee8379 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountAccountGpuLimitCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountAccountGpuLimitCommandApiCommand +{ + 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.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(@"gpu-limit", @"Account Gpu 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.AccountGpuLimitAsync( + 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..a4b4e6b6 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountApiGroupCommand.g.cs @@ -0,0 +1,23 @@ +#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(AccountAccountGpuLimitCommandApiCommand.Create()); + command.Subcommands.Add(AccountAccountRateLimitCommandApiCommand.Create()); + command.Subcommands.Add(AccountAccountUpdateDetailsCommandApiCommand.Create()); + command.Subcommands.Add(AccountDeleteAccountCommandApiCommand.Create()); + command.Subcommands.Add(AccountMeCommandApiCommand.Create()); + command.Subcommands.Add(AccountRequestGpuLimitIncreaseCommandApiCommand.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/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/AccountRequestGpuLimitIncreaseCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AccountRequestGpuLimitIncreaseCommandApiCommand.g.cs new file mode 100644 index 00000000..e41da415 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AccountRequestGpuLimitIncreaseCommandApiCommand.g.cs @@ -0,0 +1,102 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AccountRequestGpuLimitIncreaseCommandApiCommand +{ + 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 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(XApiKey); + 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 xApiKey = parseResult.GetValue(XApiKey); + 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.Account.RequestGpuLimitIncreaseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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/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..505f46c1 --- /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(AgentsOpenclawCatalogCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawCreateCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawDeleteCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawGetCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawLaunchTokenCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawListCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawListBackupsCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawRestoreBackupCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawStartCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawStopCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawTriggerBackupCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawUpdateCommandApiCommand.Create()); + command.Subcommands.Add(AgentsOpenclawUpdateVersionCommandApiCommand.Create()); + return command; + } +} \ No newline at end of file diff --git a/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawCatalogCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawCatalogCommandApiCommand.g.cs new file mode 100644 index 00000000..e423a0f0 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawCatalogCommandApiCommand.g.cs @@ -0,0 +1,72 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawCatalogCommandApiCommand +{ + 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(@"openclaw-catalog", @"Openclaw 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.OpenclawCatalogAsync( + 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/AgentsOpenclawCreateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawCreateCommandApiCommand.g.cs new file mode 100644 index 00000000..8ad115ac --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawCreateCommandApiCommand.g.cs @@ -0,0 +1,135 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawCreateCommandApiCommand +{ + 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.OpenClawCreateOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(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.OpenClawCreateOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openclaw-create", @"Openclaw Create"); + 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.OpenclawCreateAsync( + 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/AgentsOpenclawDeleteCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawDeleteCommandApiCommand.g.cs new file mode 100644 index 00000000..a75d5fe1 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawDeleteCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawDeleteCommandApiCommand +{ + 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(@"openclaw-delete", @"Openclaw Delete"); + 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.OpenclawDeleteAsync( + 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/AgentsOpenclawGetCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawGetCommandApiCommand.g.cs new file mode 100644 index 00000000..c4fb9cc6 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawGetCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawGetCommandApiCommand +{ + 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.OpenClawInstanceOut value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(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.OpenClawInstanceOut value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"openclaw-get", @"Openclaw Get"); + 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.OpenclawGetAsync( + 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/AgentsOpenclawLaunchTokenCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawLaunchTokenCommandApiCommand.g.cs new file mode 100644 index 00000000..a283d6d3 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawLaunchTokenCommandApiCommand.g.cs @@ -0,0 +1,93 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawLaunchTokenCommandApiCommand +{ + 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(@"openclaw-launch-token", @"Openclaw Launch Token +Mint a single-use launch URL for the dashboard. + +Called by the launcher page right when readyz flips ready. The launch URL +is used as a top-level navigation; /launch then sets the oc_auth cookie +and 302s into the proxied dashboard. + +The user's bearer token is stashed in Redis under the token's jti and +retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of +the URL and out of any signed payload while preserving the existing proxy +auth flow (oc_auth cookie value = bearer token). + +Refuses instances whose agent_type has has_dashboard=False (e.g. hermes)."); + 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.OpenclawLaunchTokenAsync( + 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/AgentsOpenclawListBackupsCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawListBackupsCommandApiCommand.g.cs new file mode 100644 index 00000000..724808a4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawListBackupsCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawListBackupsCommandApiCommand +{ + 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(@"openclaw-list-backups", @"Openclaw 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.OpenclawListBackupsAsync( + 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/AgentsOpenclawListCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawListCommandApiCommand.g.cs new file mode 100644 index 00000000..065a690e --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawListCommandApiCommand.g.cs @@ -0,0 +1,89 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawListCommandApiCommand +{ + 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(@"openclaw-list", @"Openclaw 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.Agents.OpenclawListAsync( + 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/AgentsOpenclawRestoreBackupCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawRestoreBackupCommandApiCommand.g.cs new file mode 100644 index 00000000..020d3db9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawRestoreBackupCommandApiCommand.g.cs @@ -0,0 +1,90 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawRestoreBackupCommandApiCommand +{ + 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(@"openclaw-restore-backup", @"Openclaw 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.OpenclawRestoreBackupAsync( + 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/AgentsOpenclawStartCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawStartCommandApiCommand.g.cs new file mode 100644 index 00000000..2e44ba9e --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawStartCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawStartCommandApiCommand +{ + 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(@"openclaw-start", @"Openclaw Start"); + 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.OpenclawStartAsync( + 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/AgentsOpenclawStopCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawStopCommandApiCommand.g.cs new file mode 100644 index 00000000..bc07b167 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawStopCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawStopCommandApiCommand +{ + 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(@"openclaw-stop", @"Openclaw Stop"); + 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.OpenclawStopAsync( + 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/AgentsOpenclawTriggerBackupCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawTriggerBackupCommandApiCommand.g.cs new file mode 100644 index 00000000..b2df16eb --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawTriggerBackupCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawTriggerBackupCommandApiCommand +{ + 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(@"openclaw-trigger-backup", @"Openclaw Trigger 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.OpenclawTriggerBackupAsync( + 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/AgentsOpenclawUpdateCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawUpdateCommandApiCommand.g.cs new file mode 100644 index 00000000..7c6720f9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawUpdateCommandApiCommand.g.cs @@ -0,0 +1,91 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawUpdateCommandApiCommand +{ + 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(@"openclaw-update", @"Openclaw Update"); + 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.OpenclawUpdateAsync( + 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/AgentsOpenclawUpdateVersionCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawUpdateVersionCommandApiCommand.g.cs new file mode 100644 index 00000000..b3768041 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AgentsOpenclawUpdateVersionCommandApiCommand.g.cs @@ -0,0 +1,81 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace DeepInfra.CLI.Commands; + +internal static partial class AgentsOpenclawUpdateVersionCommandApiCommand +{ + 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(@"openclaw-update-version", @"Openclaw Update 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.OpenclawUpdateVersionAsync( + 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/ApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs index 6004ddc0..1b1eacaa 100644 --- a/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs +++ b/src/cli/DeepInfra.CLI/Commands/ApiCommand.g.cs @@ -10,7 +10,26 @@ 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(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..2df580f5 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioSpeechCommandApiCommand.g.cs @@ -0,0 +1,182 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).", + }; + + 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(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 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, + 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..26d0ba60 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranscriptionsCommandApiCommand.g.cs @@ -0,0 +1,192 @@ +#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 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(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); + 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, + 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..ee0068d1 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AudioOpenaiAudioTranslationsCommandApiCommand.g.cs @@ -0,0 +1,174 @@ +#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 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(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); + 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, + 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..77c7cabb --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/AuthenticationApiGroupCommand.g.cs @@ -0,0 +1,27 @@ +#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(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/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..85110ac2 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCommandApiCommand.g.cs @@ -0,0 +1,256 @@ +#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 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 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(AnthropicVersion); + command.Options.Add(AnthropicBeta); + command.Options.Add(XDeepinfraSource); + command.Options.Add(XiApiKey); + command.Options.Add(XApiKey); + 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 anthropicVersion = parseResult.GetValue(AnthropicVersion); + var anthropicBeta = parseResult.GetValue(AnthropicBeta); + var xDeepinfraSource = parseResult.GetValue(XDeepinfraSource); + var xiApiKey = parseResult.GetValue(XiApiKey); + var xApiKey = parseResult.GetValue(XApiKey); + 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.ChatCompletions.AnthropicMessagesAsync( + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + 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/ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.g.cs b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.g.cs new file mode 100644 index 00000000..245be414 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsAnthropicMessagesCountTokensCommandApiCommand.g.cs @@ -0,0 +1,168 @@ +#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.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 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.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..9ef25e36 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ChatCompletionsOpenaiChatCompletionsCommandApiCommand.g.cs @@ -0,0 +1,365 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).", + }; + + 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 16384, 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, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports.", + }; + + 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 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 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(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(ChatTemplateKwargs); + command.Options.Add(ContinueFinalMessage); 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 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 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 __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, + 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, + chatTemplateKwargs: chatTemplateKwargs, + continueFinalMessage: continueFinalMessage, + 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..8df8d4e7 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsApiGroupCommand.g.cs @@ -0,0 +1,30 @@ +#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(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(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/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..a9307a08 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployCreateLlmCommandApiCommand.g.cs @@ -0,0 +1,233 @@ +#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 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 Option PresetId { get; } = new( + name: @"--preset-id") + { + Description = @"Apply a DeepInfra preset (base_model deploys only).", + }; + 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(MaxBatchSize); + 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 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 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, + maxBatchSize: maxBatchSize, + 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..2a49dec4 --- /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,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..ac0898e9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/DedicatedModelsDeployLlmPresetsCommandApiCommand.g.cs @@ -0,0 +1,111 @@ +#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 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-tested preset deploy configs for ``hf_repo_id`` (HF org/name), for +the deploy dashboard to pre-fill. An empty list — the common case — means none. +Omit ``engine`` to get presets across all engines."); + command.Options.Add(HfRepoId); + command.Options.Add(Gpu); + command.Options.Add(Engine); + 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 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, + 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/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/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..5733def9 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/EmbeddingsOpenaiEmbeddingsCommandApiCommand.g.cs @@ -0,0 +1,182 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).", + }; + + 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(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 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, + 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..3dc38c4f --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/ModelsModelMetaUpdateCommandApiCommand.g.cs @@ -0,0 +1,180 @@ +#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 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(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 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, + 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/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..aeaaff57 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/TextCompletionsOpenaiCompletionsCommandApiCommand.g.cs @@ -0,0 +1,338 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it).", + }; + + 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 16384, 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 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 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(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(Data); 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 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 data = CliRuntime.WasSpecified(parseResult, Data) ? parseResult.GetValue(Data) : (__requestBase is { } __DataBaseValue ? __DataBaseValue.Data : 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, + 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, + data: data, + 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..7eef8aa5 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideoGenerationInOptionSet.g.cs @@ -0,0 +1,59 @@ +#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) +{ + 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 = @"", + } + ); + } +} \ 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..91811029 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGeneration2CommandApiCommand.g.cs @@ -0,0 +1,131 @@ +#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(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); + 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, + 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..2caad0c4 --- /dev/null +++ b/src/cli/DeepInfra.CLI/Commands/VideosCreateVideoGenerationCommandApiCommand.g.cs @@ -0,0 +1,131 @@ +#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(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); + 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, + 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/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountEmailValues.g.cs new file mode 100644 index 00000000..eb0a52c2 --- /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.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuLimit.g.cs new file mode 100644 index 00000000..b0afdcc4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountGpuLimit.g.cs @@ -0,0 +1,517 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AccountGpuLimitSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AccountGpuLimitSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AccountGpuLimitSecurityRequirement0, + }; + partial void PrepareAccountGpuLimitArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareAccountGpuLimitRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessAccountGpuLimitResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAccountGpuLimitResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Account Gpu Limit + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AccountGpuLimitAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AccountGpuLimitAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Account Gpu Limit + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AccountGpuLimitAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAccountGpuLimitArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AccountGpuLimitSecurityRequirements, + operationName: "AccountGpuLimitAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/gpu_limit", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareAccountGpuLimitRequest( + 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: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAccountGpuLimitResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AccountGpuLimit", + methodName: "AccountGpuLimitAsync", + pathTemplate: "\"/v1/me/gpu_limit\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAccountGpuLimitResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.GpuLimitOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.GpuLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.AccountRateLimit.g.cs new file mode 100644 index 00000000..737c7723 --- /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..56aed13f --- /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..528a1924 --- /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.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.Me.g.cs new file mode 100644 index 00000000..4dfab148 --- /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.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuLimitIncrease.g.cs new file mode 100644 index 00000000..c25571cc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.RequestGpuLimitIncrease.g.cs @@ -0,0 +1,604 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AccountClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_RequestGpuLimitIncreaseSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_RequestGpuLimitIncreaseSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_RequestGpuLimitIncreaseSecurityRequirement0, + }; + partial void PrepareRequestGpuLimitIncreaseArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.GpuLimitRequestIn request); + partial void PrepareRequestGpuLimitIncreaseRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.GpuLimitRequestIn request); + partial void ProcessRequestGpuLimitIncreaseResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessRequestGpuLimitIncreaseResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RequestGpuLimitIncreaseAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> RequestGpuLimitIncreaseAsResponseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + 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); + PrepareRequestGpuLimitIncreaseArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_RequestGpuLimitIncreaseSecurityRequirements, + operationName: "RequestGpuLimitIncreaseAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/me/gpu_limit/request", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareRequestGpuLimitIncreaseRequest( + 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: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessRequestGpuLimitIncreaseResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "RequestGpuLimitIncrease", + methodName: "RequestGpuLimitIncreaseAsync", + pathTemplate: "\"/v1/me/gpu_limit/request\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Forbidden + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::DeepInfra.DeepError? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessRequestGpuLimitIncreaseResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( + string gpuType, + int requestedLimit, + string reason, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.GpuLimitRequestIn + { + GpuType = gpuType, + RequestedLimit = requestedLimit, + Reason = reason, + }; + + return await RequestGpuLimitIncreaseAsync( + xiApiKey: xiApiKey, + 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..d424b8d8 --- /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..192cdc7a --- /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..ae7caaa8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AccountClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// User profile, team management, and rate limits.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AccountClient : global::DeepInfra.IAccountClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AccountClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AccountClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AccountClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AccountClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AccountClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AccountClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCatalog.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCatalog.g.cs new file mode 100644 index 00000000..3b0dbdec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCatalog.g.cs @@ -0,0 +1,554 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawCatalogSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawCatalogSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawCatalogSecurityRequirement0, + }; + partial void PrepareOpenclawCatalogArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawCatalogRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawCatalogResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawCatalogResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Catalog + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawCatalogAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawCatalogAsResponseAsync( + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Catalog + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> OpenclawCatalogAsResponseAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawCatalogArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawCatalogSecurityRequirements, + operationName: "OpenclawCatalogAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/agents/catalog", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawCatalogRequest( + 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: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawCatalogResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCatalog", + methodName: "OpenclawCatalogAsync", + pathTemplate: "\"/v1/agents/catalog\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawCatalogResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.Dictionary?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.Dictionary?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.Dictionary), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCreate.g.cs new file mode 100644 index 00000000..74e8aa4b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawCreate.g.cs @@ -0,0 +1,727 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawCreateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawCreateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawCreateSecurityRequirement0, + }; + partial void PrepareOpenclawCreateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.OpenClawCreateIn request); + partial void PrepareOpenclawCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.OpenClawCreateIn request); + partial void ProcessOpenclawCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Create + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawCreateAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawCreateAsResponseAsync( + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Create + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawCreateAsResponseAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + 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); + PrepareOpenclawCreateArguments( + httpClient: HttpClient, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawCreateSecurityRequirements, + operationName: "OpenclawCreateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawCreateRequest( + 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: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawCreate", + methodName: "OpenclawCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Payment Required + if ((int)__response.StatusCode == 402) + { + string? __content_402 = null; + global::System.Exception? __exception_402 = null; + global::DeepInfra.DeepError? __value_402 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); + } + else + { + __content_402 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_402 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_402, + responseBody: __content_402, + responseObject: __value_402, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Too Many Requests + if ((int)__response.StatusCode == 429) + { + string? __content_429 = null; + global::System.Exception? __exception_429 = null; + global::DeepInfra.DeepError? __value_429 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); + } + else + { + __content_429 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_429 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_429, + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Service Unavailable + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::DeepInfra.DeepError? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::DeepInfra.DeepError.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::DeepInfra.DeepError.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenClawCreateOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.OpenClawCreateOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Openclaw Create + /// + /// + /// + /// + /// Instance name + /// + /// + /// Agent type identifier
+ /// Default Value: openclaw + /// + /// + /// Plan identifier
+ /// Default Value: standard + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawCreateAsync( + string name, + string? xiApiKey = default, + string? xApiKey = default, + string? agentTypeId = default, + string? planId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenClawCreateIn + { + Name = name, + AgentTypeId = agentTypeId, + PlanId = planId, + }; + + return await OpenclawCreateAsync( + xiApiKey: xiApiKey, + 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.OpenclawDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawDelete.g.cs new file mode 100644 index 00000000..11664826 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawDelete.g.cs @@ -0,0 +1,559 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawDeleteSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawDeleteSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawDeleteSecurityRequirement0, + }; + partial void PrepareOpenclawDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawDeleteResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Delete + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawDeleteAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawDeleteAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Delete + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawDeleteAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawDeleteArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawDeleteSecurityRequirements, + operationName: "OpenclawDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawDeleteRequest( + 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: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawDelete", + methodName: "OpenclawDeleteAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawDeleteResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawGet.g.cs new file mode 100644 index 00000000..ad97aa5a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawGet.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawGetSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawGetSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawGetSecurityRequirement0, + }; + partial void PrepareOpenclawGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Get + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawGetAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawGetAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Get + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawGetAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawGetArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawGetSecurityRequirements, + operationName: "OpenclawGetAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawGetRequest( + 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: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawGet", + methodName: "OpenclawGetAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenClawInstanceOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.OpenClawInstanceOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawLaunchToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawLaunchToken.g.cs new file mode 100644 index 00000000..d7d34718 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawLaunchToken.g.cs @@ -0,0 +1,618 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawLaunchTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawLaunchTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawLaunchTokenSecurityRequirement0, + }; + partial void PrepareOpenclawLaunchTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawLaunchTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawLaunchTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawLaunchTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawLaunchTokenAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawLaunchTokenAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawLaunchTokenAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawLaunchTokenArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawLaunchTokenSecurityRequirements, + operationName: "OpenclawLaunchTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/launch_token", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawLaunchTokenRequest( + 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: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawLaunchTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawLaunchToken", + methodName: "OpenclawLaunchTokenAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/launch_token\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::DeepInfra.DeepError? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawLaunchTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenClawLaunchTokenOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.OpenClawLaunchTokenOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawList.g.cs new file mode 100644 index 00000000..6327bd12 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawList.g.cs @@ -0,0 +1,535 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawListSecurityRequirement0, + }; + partial void PrepareOpenclawListArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::DeepInfra.OpenclawListV1AgentsGetState? state, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::DeepInfra.OpenclawListV1AgentsGetState? state, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawListAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawListAsResponseAsync( + state: state, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> OpenclawListAsResponseAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawListArguments( + httpClient: HttpClient, + state: ref state, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawListSecurityRequirements, + operationName: "OpenclawListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/agents", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("state", state?.ToValueString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawListRequest( + 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: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawList", + methodName: "OpenclawListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawListBackups.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawListBackups.g.cs new file mode 100644 index 00000000..b987a1c8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawListBackups.g.cs @@ -0,0 +1,563 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawListBackupsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawListBackupsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawListBackupsSecurityRequirement0, + }; + partial void PrepareOpenclawListBackupsArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawListBackupsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawListBackupsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawListBackupsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw List Backups + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawListBackupsAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawListBackupsAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw List Backups + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> OpenclawListBackupsAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawListBackupsArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawListBackupsSecurityRequirements, + operationName: "OpenclawListBackupsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/backups", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawListBackupsRequest( + 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: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawListBackupsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawListBackups", + methodName: "OpenclawListBackupsAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawListBackupsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawRestoreBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawRestoreBackup.g.cs new file mode 100644 index 00000000..4062342d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawRestoreBackup.g.cs @@ -0,0 +1,605 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawRestoreBackupSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawRestoreBackupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawRestoreBackupSecurityRequirement0, + }; + partial void PrepareOpenclawRestoreBackupArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string backupId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawRestoreBackupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string backupId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawRestoreBackupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawRestoreBackupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawRestoreBackupAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawRestoreBackupAsResponseAsync( + instanceId: instanceId, + backupId: backupId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawRestoreBackupAsResponseAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawRestoreBackupArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + backupId: ref backupId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawRestoreBackupSecurityRequirements, + operationName: "OpenclawRestoreBackupAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/backups/{backupId}/restore", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawRestoreBackupRequest( + 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: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawRestoreBackupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawRestoreBackup", + methodName: "OpenclawRestoreBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backups/{backupId}/restore\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawRestoreBackupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStart.g.cs new file mode 100644 index 00000000..9de7c45a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStart.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawStartSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawStartSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawStartSecurityRequirement0, + }; + partial void PrepareOpenclawStartArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawStartRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawStartResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawStartResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Start + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawStartAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawStartAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Start + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawStartAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawStartArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawStartSecurityRequirements, + operationName: "OpenclawStartAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/start", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawStartRequest( + 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: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawStartResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStart", + methodName: "OpenclawStartAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/start\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawStartResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStop.g.cs new file mode 100644 index 00000000..b5476e14 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawStop.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawStopSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawStopSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawStopSecurityRequirement0, + }; + partial void PrepareOpenclawStopArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawStopRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawStopResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawStopResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Stop + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawStopAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawStopAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Stop + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawStopAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawStopArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawStopSecurityRequirements, + operationName: "OpenclawStopAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/stop", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawStopRequest( + 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: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawStopResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawStop", + methodName: "OpenclawStopAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/stop\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawStopResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawTriggerBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawTriggerBackup.g.cs new file mode 100644 index 00000000..0d718ddf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawTriggerBackup.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawTriggerBackupSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawTriggerBackupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawTriggerBackupSecurityRequirement0, + }; + partial void PrepareOpenclawTriggerBackupArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawTriggerBackupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawTriggerBackupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawTriggerBackupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawTriggerBackupAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawTriggerBackupAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawTriggerBackupAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawTriggerBackupArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawTriggerBackupSecurityRequirements, + operationName: "OpenclawTriggerBackupAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/backup", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawTriggerBackupRequest( + 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: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawTriggerBackupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawTriggerBackup", + methodName: "OpenclawTriggerBackupAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/backup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawTriggerBackupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdate.g.cs new file mode 100644 index 00000000..4e4c2f5d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdate.g.cs @@ -0,0 +1,612 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawUpdateSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawUpdateSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawUpdateSecurityRequirement0, + }; + partial void PrepareOpenclawUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey, + global::DeepInfra.OpenClawUpdateIn request); + partial void PrepareOpenclawUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey, + global::DeepInfra.OpenClawUpdateIn request); + partial void ProcessOpenclawUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Update + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawUpdateAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawUpdateAsResponseAsync( + instanceId: instanceId, + + request: request, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Update + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawUpdateAsResponseAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + 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); + PrepareOpenclawUpdateArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawUpdateSecurityRequirements, + operationName: "OpenclawUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawUpdateRequest( + 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: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdate", + methodName: "OpenclawUpdateAsync", + pathTemplate: "$\"/v1/agents/{instanceId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Openclaw Update + /// + /// + /// + /// + /// + /// Instance name + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawUpdateAsync( + string instanceId, + string name, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenClawUpdateIn + { + Name = name, + }; + + return await OpenclawUpdateAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + 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.OpenclawUpdateVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdateVersion.g.cs new file mode 100644 index 00000000..1e2cc1fa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.OpenclawUpdateVersion.g.cs @@ -0,0 +1,596 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AgentsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenclawUpdateVersionSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenclawUpdateVersionSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenclawUpdateVersionSecurityRequirement0, + }; + partial void PrepareOpenclawUpdateVersionArguments( + global::System.Net.Http.HttpClient httpClient, + ref string instanceId, + ref string? xiApiKey, + ref string? xApiKey); + partial void PrepareOpenclawUpdateVersionRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string instanceId, + string? xiApiKey, + string? xApiKey); + partial void ProcessOpenclawUpdateVersionResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenclawUpdateVersionResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openclaw Update Version + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenclawUpdateVersionAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenclawUpdateVersionAsResponseAsync( + instanceId: instanceId, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openclaw Update Version + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenclawUpdateVersionAsResponseAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenclawUpdateVersionArguments( + httpClient: HttpClient, + instanceId: ref instanceId, + xiApiKey: ref xiApiKey, + xApiKey: ref xApiKey); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenclawUpdateVersionSecurityRequirements, + operationName: "OpenclawUpdateVersionAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/v1/agents/{instanceId}/update", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + + if (xiApiKey != default) + { + __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); + } + 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); + PrepareOpenclawUpdateVersionRequest( + 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: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenclawUpdateVersionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenclawUpdateVersion", + methodName: "OpenclawUpdateVersionAsync", + pathTemplate: "$\"/v1/agents/{instanceId}/update\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::DeepInfra.DeepError? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::DeepInfra.DeepError? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenclawUpdateVersionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs new file mode 100644 index 00000000..7c91548b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AgentsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Manage agent-framework instances (OpenClaw and friends).
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AgentsClient : global::DeepInfra.IAgentsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AgentsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AgentsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AgentsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AgentsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AgentsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AgentsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.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..3f4a7e9b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.2.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -41,6 +61,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] #endif public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); /// /// /// @@ -59,6 +99,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -77,6 +122,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -143,6 +193,30 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, bool validate = true) { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.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..2ce7efb8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.3.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace DeepInfra #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -58,6 +98,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] #endif public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); /// /// /// @@ -76,6 +136,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -94,6 +159,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -112,6 +182,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -187,6 +262,36 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, bool validate = true) diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.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..8cc3f9ec 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.4.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace DeepInfra #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace DeepInfra #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -75,6 +135,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] #endif public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); /// /// /// @@ -93,6 +173,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -111,6 +196,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -129,6 +219,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -147,6 +242,11 @@ public AnyOf(T4? value) Value4 = value; } + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + /// /// /// @@ -231,6 +331,42 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.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..b780455c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.5.g.cs @@ -25,6 +25,26 @@ namespace DeepInfra #endif public bool IsValue1 => Value1 != null; + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + /// /// /// @@ -42,6 +62,26 @@ namespace DeepInfra #endif public bool IsValue2 => Value2 != null; + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// /// /// @@ -59,6 +99,26 @@ namespace DeepInfra #endif public bool IsValue3 => Value3 != null; + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + /// /// /// @@ -76,6 +136,26 @@ namespace DeepInfra #endif public bool IsValue4 => Value4 != null; + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); + /// /// /// @@ -92,6 +172,26 @@ namespace DeepInfra [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] #endif public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } + + /// + /// + /// + public T5 PickValue5() => IsValue5 + ? Value5! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value5' but the value was {ToString()}."); /// /// /// @@ -110,6 +210,11 @@ public AnyOf(T1? value) Value1 = value; } + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + /// /// /// @@ -128,6 +233,11 @@ public AnyOf(T2? value) Value2 = value; } + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + /// /// /// @@ -146,6 +256,11 @@ public AnyOf(T3? value) Value3 = value; } + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + /// /// /// @@ -164,6 +279,11 @@ public AnyOf(T4? value) Value4 = value; } + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + /// /// /// @@ -182,6 +302,11 @@ public AnyOf(T5? value) Value5 = value; } + /// + /// + /// + public static AnyOf FromValue5(T5? value) => new AnyOf(value); + /// /// /// @@ -275,6 +400,48 @@ public bool Validate() /// public void Match( global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, global::System.Action? value2 = null, global::System.Action? value3 = null, global::System.Action? value4 = null, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.Json.g.cs deleted file mode 100644 index 3d365af6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public readonly partial struct AnyOf - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.AnyOf? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AnyOf), - jsonSerializerContext) as global::DeepInfra.AnyOf?; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.AnyOf? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize>( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.AnyOf), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnyOf?; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.g.cs deleted file mode 100644 index 57f5215f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.8.g.cs +++ /dev/null @@ -1,532 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public readonly partial struct AnyOf : global::System.IEquatable> - { - /// - /// - /// -#if NET6_0_OR_GREATER - public T1? Value1 { get; init; } -#else - public T1? Value1 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] -#endif - public bool IsValue1 => Value1 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T2? Value2 { get; init; } -#else - public T2? Value2 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] -#endif - public bool IsValue2 => Value2 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T3? Value3 { get; init; } -#else - public T3? Value3 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] -#endif - public bool IsValue3 => Value3 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T4? Value4 { get; init; } -#else - public T4? Value4 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] -#endif - public bool IsValue4 => Value4 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T5? Value5 { get; init; } -#else - public T5? Value5 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] -#endif - public bool IsValue5 => Value5 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T6? Value6 { get; init; } -#else - public T6? Value6 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] -#endif - public bool IsValue6 => Value6 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T7? Value7 { get; init; } -#else - public T7? Value7 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value7))] -#endif - public bool IsValue7 => Value7 != null; - - /// - /// - /// -#if NET6_0_OR_GREATER - public T8? Value8 { get; init; } -#else - public T8? Value8 { get; } -#endif - - /// - /// - /// -#if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value8))] -#endif - public bool IsValue8 => Value8 != null; - /// - /// - /// - public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); - - /// - /// - /// - public static implicit operator T1?(AnyOf @this) => @this.Value1; - - /// - /// - /// - public AnyOf(T1? value) - { - Value1 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); - - /// - /// - /// - public static implicit operator T2?(AnyOf @this) => @this.Value2; - - /// - /// - /// - public AnyOf(T2? value) - { - Value2 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T3 value) => new AnyOf((T3?)value); - - /// - /// - /// - public static implicit operator T3?(AnyOf @this) => @this.Value3; - - /// - /// - /// - public AnyOf(T3? value) - { - Value3 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T4 value) => new AnyOf((T4?)value); - - /// - /// - /// - public static implicit operator T4?(AnyOf @this) => @this.Value4; - - /// - /// - /// - public AnyOf(T4? value) - { - Value4 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T5 value) => new AnyOf((T5?)value); - - /// - /// - /// - public static implicit operator T5?(AnyOf @this) => @this.Value5; - - /// - /// - /// - public AnyOf(T5? value) - { - Value5 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T6 value) => new AnyOf((T6?)value); - - /// - /// - /// - public static implicit operator T6?(AnyOf @this) => @this.Value6; - - /// - /// - /// - public AnyOf(T6? value) - { - Value6 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T7 value) => new AnyOf((T7?)value); - - /// - /// - /// - public static implicit operator T7?(AnyOf @this) => @this.Value7; - - /// - /// - /// - public AnyOf(T7? value) - { - Value7 = value; - } - - /// - /// - /// - public static implicit operator AnyOf(T8 value) => new AnyOf((T8?)value); - - /// - /// - /// - public static implicit operator T8?(AnyOf @this) => @this.Value8; - - /// - /// - /// - public AnyOf(T8? value) - { - Value8 = value; - } - - /// - /// - /// - public AnyOf( - T1? value1, - T2? value2, - T3? value3, - T4? value4, - T5? value5, - T6? value6, - T7? value7, - T8? value8 - ) - { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - Value5 = value5; - Value6 = value6; - Value7 = value7; - Value8 = value8; - } - - /// - /// - /// - public object? Object => - Value8 as object ?? - Value7 as object ?? - Value6 as object ?? - Value5 as object ?? - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object - ; - - /// - /// - /// - public override string? ToString() => - Value1?.ToString() ?? - Value2?.ToString() ?? - Value3?.ToString() ?? - Value4?.ToString() ?? - Value5?.ToString() ?? - Value6?.ToString() ?? - Value7?.ToString() ?? - Value8?.ToString() - ; - - /// - /// - /// - public bool Validate() - { - return IsValue1 || IsValue2 || IsValue3 || IsValue4 || IsValue5 || IsValue6 || IsValue7 || IsValue8; - } - - /// - /// - /// - public TResult? Match( - global::System.Func? value1 = null, - global::System.Func? value2 = null, - global::System.Func? value3 = null, - global::System.Func? value4 = null, - global::System.Func? value5 = null, - global::System.Func? value6 = null, - global::System.Func? value7 = null, - global::System.Func? value8 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsValue1 && value1 != null) - { - return value1(Value1!); - } - else if (IsValue2 && value2 != null) - { - return value2(Value2!); - } - else if (IsValue3 && value3 != null) - { - return value3(Value3!); - } - else if (IsValue4 && value4 != null) - { - return value4(Value4!); - } - else if (IsValue5 && value5 != null) - { - return value5(Value5!); - } - else if (IsValue6 && value6 != null) - { - return value6(Value6!); - } - else if (IsValue7 && value7 != null) - { - return value7(Value7!); - } - else if (IsValue8 && value8 != null) - { - return value8(Value8!); - } - - return default(TResult); - } - - /// - /// - /// - public void Match( - global::System.Action? value1 = null, - global::System.Action? value2 = null, - global::System.Action? value3 = null, - global::System.Action? value4 = null, - global::System.Action? value5 = null, - global::System.Action? value6 = null, - global::System.Action? value7 = null, - global::System.Action? value8 = null, - bool validate = true) - { - if (validate) - { - Validate(); - } - - if (IsValue1) - { - value1?.Invoke(Value1!); - } - else if (IsValue2) - { - value2?.Invoke(Value2!); - } - else if (IsValue3) - { - value3?.Invoke(Value3!); - } - else if (IsValue4) - { - value4?.Invoke(Value4!); - } - else if (IsValue5) - { - value5?.Invoke(Value5!); - } - else if (IsValue6) - { - value6?.Invoke(Value6!); - } - else if (IsValue7) - { - value7?.Invoke(Value7!); - } - else if (IsValue8) - { - value8?.Invoke(Value8!); - } - } - - /// - /// - /// - public override int GetHashCode() - { - var fields = new object?[] - { - Value1, - typeof(T1), - Value2, - typeof(T2), - Value3, - typeof(T3), - Value4, - typeof(T4), - Value5, - typeof(T5), - Value6, - typeof(T6), - Value7, - typeof(T7), - Value8, - typeof(T8), - }; - const int offset = unchecked((int)2166136261); - const int prime = 16777619; - static int HashCodeAggregator(int hashCode, object? value) => value == null - ? (hashCode ^ 0) * prime - : (hashCode ^ value.GetHashCode()) * prime; - - return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); - } - - /// - /// - /// - public bool Equals(AnyOf other) - { - return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value6, other.Value6) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value7, other.Value7) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value8, other.Value8) - ; - } - - /// - /// - /// - public static bool operator ==(AnyOf obj1, AnyOf obj2) - { - return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); - } - - /// - /// - /// - public static bool operator !=(AnyOf obj1, AnyOf obj2) - { - return !(obj1 == obj2); - } - - /// - /// - /// - public override bool Equals(object? obj) - { - return obj is AnyOf o && Equals(o); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.Json.g.cs new file mode 100644 index 00000000..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..71ac55ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AnyOf.9.g.cs @@ -0,0 +1,875 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public readonly partial struct AnyOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T3? Value3 { get; init; } +#else + public T3? Value3 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] +#endif + public bool IsValue3 => Value3 != null; + + /// + /// + /// + public bool TryPickValue3( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T3? value) + { + value = Value3; + return IsValue3; + } + + /// + /// + /// + public T3 PickValue3() => IsValue3 + ? Value3! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value3' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T4? Value4 { get; init; } +#else + public T4? Value4 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] +#endif + public bool IsValue4 => Value4 != null; + + /// + /// + /// + public bool TryPickValue4( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T4? value) + { + value = Value4; + return IsValue4; + } + + /// + /// + /// + public T4 PickValue4() => IsValue4 + ? Value4! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value4' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T5? Value5 { get; init; } +#else + public T5? Value5 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] +#endif + public bool IsValue5 => Value5 != null; + + /// + /// + /// + public bool TryPickValue5( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T5? value) + { + value = Value5; + return IsValue5; + } + + /// + /// + /// + public T5 PickValue5() => IsValue5 + ? Value5! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value5' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T6? Value6 { get; init; } +#else + public T6? Value6 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] +#endif + public bool IsValue6 => Value6 != null; + + /// + /// + /// + public bool TryPickValue6( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T6? value) + { + value = Value6; + return IsValue6; + } + + /// + /// + /// + public T6 PickValue6() => IsValue6 + ? Value6! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value6' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T7? Value7 { get; init; } +#else + public T7? Value7 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value7))] +#endif + public bool IsValue7 => Value7 != null; + + /// + /// + /// + public bool TryPickValue7( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T7? value) + { + value = Value7; + return IsValue7; + } + + /// + /// + /// + public T7 PickValue7() => IsValue7 + ? Value7! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value7' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T8? Value8 { get; init; } +#else + public T8? Value8 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value8))] +#endif + public bool IsValue8 => Value8 != null; + + /// + /// + /// + public bool TryPickValue8( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T8? value) + { + value = Value8; + return IsValue8; + } + + /// + /// + /// + public T8 PickValue8() => IsValue8 + ? Value8! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value8' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T9? Value9 { get; init; } +#else + public T9? Value9 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value9))] +#endif + public bool IsValue9 => Value9 != null; + + /// + /// + /// + public bool TryPickValue9( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T9? value) + { + value = Value9; + return IsValue9; + } + + /// + /// + /// + public T9 PickValue9() => IsValue9 + ? Value9! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value9' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator AnyOf(T1 value) => new AnyOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(AnyOf @this) => @this.Value1; + + /// + /// + /// + public AnyOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static AnyOf FromValue1(T1? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T2 value) => new AnyOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(AnyOf @this) => @this.Value2; + + /// + /// + /// + public AnyOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static AnyOf FromValue2(T2? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T3 value) => new AnyOf((T3?)value); + + /// + /// + /// + public static implicit operator T3?(AnyOf @this) => @this.Value3; + + /// + /// + /// + public AnyOf(T3? value) + { + Value3 = value; + } + + /// + /// + /// + public static AnyOf FromValue3(T3? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T4 value) => new AnyOf((T4?)value); + + /// + /// + /// + public static implicit operator T4?(AnyOf @this) => @this.Value4; + + /// + /// + /// + public AnyOf(T4? value) + { + Value4 = value; + } + + /// + /// + /// + public static AnyOf FromValue4(T4? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T5 value) => new AnyOf((T5?)value); + + /// + /// + /// + public static implicit operator T5?(AnyOf @this) => @this.Value5; + + /// + /// + /// + public AnyOf(T5? value) + { + Value5 = value; + } + + /// + /// + /// + public static AnyOf FromValue5(T5? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T6 value) => new AnyOf((T6?)value); + + /// + /// + /// + public static implicit operator T6?(AnyOf @this) => @this.Value6; + + /// + /// + /// + public AnyOf(T6? value) + { + Value6 = value; + } + + /// + /// + /// + public static AnyOf FromValue6(T6? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T7 value) => new AnyOf((T7?)value); + + /// + /// + /// + public static implicit operator T7?(AnyOf @this) => @this.Value7; + + /// + /// + /// + public AnyOf(T7? value) + { + Value7 = value; + } + + /// + /// + /// + public static AnyOf FromValue7(T7? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T8 value) => new AnyOf((T8?)value); + + /// + /// + /// + public static implicit operator T8?(AnyOf @this) => @this.Value8; + + /// + /// + /// + public AnyOf(T8? value) + { + Value8 = value; + } + + /// + /// + /// + public static AnyOf FromValue8(T8? value) => new AnyOf(value); + + /// + /// + /// + public static implicit operator AnyOf(T9 value) => new AnyOf((T9?)value); + + /// + /// + /// + public static implicit operator T9?(AnyOf @this) => @this.Value9; + + /// + /// + /// + public AnyOf(T9? value) + { + Value9 = value; + } + + /// + /// + /// + public static AnyOf FromValue9(T9? value) => new AnyOf(value); + + /// + /// + /// + public AnyOf( + T1? value1, + T2? value2, + T3? value3, + T4? value4, + T5? value5, + T6? value6, + T7? value7, + T8? value8, + T9? value9 + ) + { + Value1 = value1; + Value2 = value2; + Value3 = value3; + Value4 = value4; + Value5 = value5; + Value6 = value6; + Value7 = value7; + Value8 = value8; + Value9 = value9; + } + + /// + /// + /// + public object? Object => + Value9 as object ?? + Value8 as object ?? + Value7 as object ?? + Value6 as object ?? + Value5 as object ?? + Value4 as object ?? + Value3 as object ?? + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() ?? + Value3?.ToString() ?? + Value4?.ToString() ?? + Value5?.ToString() ?? + Value6?.ToString() ?? + Value7?.ToString() ?? + Value8?.ToString() ?? + Value9?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 || IsValue2 || IsValue3 || IsValue4 || IsValue5 || IsValue6 || IsValue7 || IsValue8 || IsValue9; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + global::System.Func? value3 = null, + global::System.Func? value4 = null, + global::System.Func? value5 = null, + global::System.Func? value6 = null, + global::System.Func? value7 = null, + global::System.Func? value8 = null, + global::System.Func? value9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + else if (IsValue3 && value3 != null) + { + return value3(Value3!); + } + else if (IsValue4 && value4 != null) + { + return value4(Value4!); + } + else if (IsValue5 && value5 != null) + { + return value5(Value5!); + } + else if (IsValue6 && value6 != null) + { + return value6(Value6!); + } + else if (IsValue7 && value7 != null) + { + return value7(Value7!); + } + else if (IsValue8 && value8 != null) + { + return value8(Value8!); + } + else if (IsValue9 && value9 != null) + { + return value9(Value9!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + + global::System.Action? value3 = null, + + global::System.Action? value4 = null, + + global::System.Action? value5 = null, + + global::System.Action? value6 = null, + + global::System.Action? value7 = null, + + global::System.Action? value8 = null, + + global::System.Action? value9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + else if (IsValue8) + { + value8?.Invoke(Value8!); + } + else if (IsValue9) + { + value9?.Invoke(Value9!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + global::System.Action? value3 = null, + global::System.Action? value4 = null, + global::System.Action? value5 = null, + global::System.Action? value6 = null, + global::System.Action? value7 = null, + global::System.Action? value8 = null, + global::System.Action? value9 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + else if (IsValue3) + { + value3?.Invoke(Value3!); + } + else if (IsValue4) + { + value4?.Invoke(Value4!); + } + else if (IsValue5) + { + value5?.Invoke(Value5!); + } + else if (IsValue6) + { + value6?.Invoke(Value6!); + } + else if (IsValue7) + { + value7?.Invoke(Value7!); + } + else if (IsValue8) + { + value8?.Invoke(Value8!); + } + else if (IsValue9) + { + value9?.Invoke(Value9!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + Value3, + typeof(T3), + Value4, + typeof(T4), + Value5, + typeof(T5), + Value6, + typeof(T6), + Value7, + typeof(T7), + Value8, + typeof(T8), + Value9, + typeof(T9), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(AnyOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value6, other.Value6) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value7, other.Value7) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value8, other.Value8) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value9, other.Value9) + ; + } + + /// + /// + /// + public static bool operator ==(AnyOf obj1, AnyOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(AnyOf obj1, AnyOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is AnyOf o && Equals(o); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs new file mode 100644 index 00000000..32bd7aca --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioSpeech.g.cs @@ -0,0 +1,574 @@ + +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// Text to convert to speech + /// + /// + /// Preset voices to use for the speech. + /// + /// + /// response format for the speech
+ /// Default Value: wav + /// + /// + /// speed of the speech
+ /// Default Value: 1F + /// + /// + /// Extra body parameters for the model. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( + string model, + string input, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + string? voice = default, + global::DeepInfra.TtsResponseFormat? responseFormat = default, + double? speed = default, + object? extraBody = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAITextToSpeechIn + { + ServiceTier = serviceTier, + Model = model, + Input = input, + Voice = voice, + ResponseFormat = responseFormat, + Speed = speed, + ExtraBody = extraBody, + }; + + return await OpenaiAudioSpeechAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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..8deccf5d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranscriptions.g.cs @@ -0,0 +1,1787 @@ + +#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(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Language != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty), + name: "\"language\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + if (request.TimestampGranularities != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TimestampGranularities.ToString() ?? string.Empty), + name: "\"timestamp_granularities\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost + { + File = file, + Filename = filename, + Model = model, + Language = language, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + TimestampGranularities = timestampGranularities, + }; + + return await OpenaiAudioTranscriptionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Language = language, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + TimestampGranularities = timestampGranularities, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + 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(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Language != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty), + name: "\"language\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + if (request.TimestampGranularities != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TimestampGranularities.ToString() ?? string.Empty), + name: "\"timestamp_granularities\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Language = language, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + TimestampGranularities = timestampGranularities, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranscriptionsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + 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(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Language != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty), + name: "\"language\""); + + } + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + if (request.TimestampGranularities != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.TimestampGranularities.ToString() ?? string.Empty), + name: "\"timestamp_granularities\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranscriptionsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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..373c5aa9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.OpenaiAudioTranslations.g.cs @@ -0,0 +1,1721 @@ + +#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(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranslationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost + { + File = file, + Filename = filename, + Model = model, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + }; + + return await OpenaiAudioTranslationsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + 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(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranslationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + + file = file ?? throw new global::System.ArgumentNullException(nameof(file)); + var request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost + { + File = global::System.Array.Empty(), + Filename = filename, + Model = model, + Prompt = prompt, + ResponseFormat = responseFormat, + Temperature = temperature, + }; + PrepareArguments( + client: HttpClient); + PrepareOpenaiAudioTranslationsArguments( + httpClient: HttpClient, + xDeepinfraSource: ref xDeepinfraSource, + xiApiKey: ref xiApiKey, + 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(); + if (xDeepinfraSource != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xDeepinfraSource ?? string.Empty), + name: "\"x-deepinfra-source\""); + + } + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentFile = new global::System.Net.Http.StreamContent(file); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Filename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + if (request.Prompt != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + } + if (request.ResponseFormat != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.ResponseFormat.ToString() ?? string.Empty), + name: "\"response_format\""); + + } + if (request.Temperature != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"temperature\""); + + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiAudioTranslationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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..56da242f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AudioClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible speech synthesis, transcription, and translation.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AudioClient : global::DeepInfra.IAudioClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AudioClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AudioClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AudioClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AudioClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AudioClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AudioClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.CreateApiToken.g.cs new file mode 100644 index 00000000..59acf726 --- /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..37d0223d --- /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..b74f4c40 --- /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..7ce77661 --- /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..2ced9732 --- /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..7e5a66df --- /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..55ee0383 --- /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..fd4b3c5f --- /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..b047e3d0 --- /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..1729d173 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubCliLogin.g.cs @@ -0,0 +1,464 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GithubCliLoginSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GithubCliLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GithubCliLoginSecurityRequirement0, + }; + partial void PrepareGithubCliLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string loginId); + partial void PrepareGithubCliLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string loginId); + partial void ProcessGithubCliLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGithubCliLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Github Cli Login
+ /// deepctl is calling this request waiting for auth token during login.
+ /// The token is stored in /github/callback + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GithubCliLoginAsync( + string loginId, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GithubCliLoginAsResponseAsync( + loginId: loginId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Github Cli Login
+ /// deepctl is calling this request waiting for auth token during login.
+ /// The token is stored in /github/callback + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GithubCliLoginAsResponseAsync( + string loginId, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGithubCliLoginArguments( + httpClient: HttpClient, + loginId: ref loginId); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GithubCliLoginSecurityRequirements, + operationName: "GithubCliLoginAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/github/cli/login", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("login_id", loginId) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGithubCliLoginRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loginId: loginId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGithubCliLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubCliLogin", + methodName: "GithubCliLoginAsync", + pathTemplate: "\"/github/cli/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGithubCliLoginResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubLogin.g.cs new file mode 100644 index 00000000..d9bf9912 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.GithubLogin.g.cs @@ -0,0 +1,492 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GithubLoginSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GithubLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GithubLoginSecurityRequirement0, + }; + partial void PrepareGithubLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? loginId, + ref string? origin, + ref string? deal, + ref string? tiToken); + partial void PrepareGithubLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? loginId, + string? origin, + string? deal, + string? tiToken); + partial void ProcessGithubLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGithubLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Github Login
+ /// Initiate github SSO login flow. Callback is /github/callback + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GithubLoginAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GithubLoginAsResponseAsync( + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Github Login
+ /// Initiate github SSO login flow. Callback is /github/callback + ///
+ /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GithubLoginAsResponseAsync( + string? loginId = default, + string? origin = default, + string? deal = default, + string? tiToken = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGithubLoginArguments( + httpClient: HttpClient, + loginId: ref loginId, + origin: ref origin, + deal: ref deal, + tiToken: ref tiToken); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GithubLoginSecurityRequirements, + operationName: "GithubLoginAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/github/login", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("login_id", loginId) + .AddOptionalParameter("origin", origin) + .AddOptionalParameter("deal", deal) + .AddOptionalParameter("ti_token", tiToken) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGithubLoginRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + loginId: loginId, + origin: origin, + deal: deal, + tiToken: tiToken); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGithubLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GithubLogin", + methodName: "GithubLoginAsync", + pathTemplate: "\"/github/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGithubLoginResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.InspectScopedJwt.g.cs new file mode 100644 index 00000000..d8d69e4e --- /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..7350a0e5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.OktaLogin.g.cs @@ -0,0 +1,480 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class AuthenticationClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OktaLoginSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OktaLoginSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OktaLoginSecurityRequirement0, + }; + partial void PrepareOktaLoginArguments( + global::System.Net.Http.HttpClient httpClient, + ref string teamId, + ref string? origin, + ref string? loginId); + partial void PrepareOktaLoginRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string teamId, + string? origin, + string? loginId); + partial void ProcessOktaLoginResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOktaLoginResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Okta Login + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OktaLoginAsync( + string teamId, + string? origin = default, + string? loginId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OktaLoginAsResponseAsync( + teamId: teamId, + origin: origin, + loginId: loginId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Okta Login + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OktaLoginAsResponseAsync( + string teamId, + string? origin = default, + string? loginId = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOktaLoginArguments( + httpClient: HttpClient, + teamId: ref teamId, + origin: ref origin, + loginId: ref loginId); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OktaLoginSecurityRequirements, + operationName: "OktaLoginAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/okta/login", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("team_id", teamId) + .AddOptionalParameter("origin", origin) + .AddOptionalParameter("login_id", loginId) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOktaLoginRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + teamId: teamId!, + origin: origin, + loginId: loginId); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOktaLoginResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OktaLogin", + methodName: "OktaLoginAsync", + pathTemplate: "\"/okta/login\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOktaLoginResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs new file mode 100644 index 00000000..6529b629 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AuthenticationClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// API tokens, SSH keys, scoped JWTs, and login flows.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class AuthenticationClient : global::DeepInfra.IAuthenticationClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the AuthenticationClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthenticationClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthenticationClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthenticationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the AuthenticationClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public AuthenticationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.AutoSDKHttpResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.AutoSDKHttpResponse.g.cs new file mode 100644 index 00000000..0e7d294a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.AddFunds.g.cs new file mode 100644 index 00000000..7fae4eb4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.AddFunds.g.cs @@ -0,0 +1,541 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_AddFundsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_AddFundsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_AddFundsSecurityRequirement0, + }; + partial void PrepareAddFundsArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? useCheckout, + object? session, + global::DeepInfra.AddFundsIn request); + partial void PrepareAddFundsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? useCheckout, + object? session, + global::DeepInfra.AddFundsIn request); + partial void ProcessAddFundsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAddFundsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AddFundsAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddFundsAsResponseAsync( + + request: request, + useCheckout: useCheckout, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AddFundsAsResponseAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAddFundsArguments( + httpClient: HttpClient, + useCheckout: ref useCheckout, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AddFundsSecurityRequirements, + operationName: "AddFundsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/funds", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("use_checkout", useCheckout?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAddFundsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + useCheckout: useCheckout, + session: session, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAddFundsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AddFunds", + methodName: "AddFundsAsync", + pathTemplate: "\"/payment/funds\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAddFundsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.AddFundsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.AddFundsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Amount to add in cents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AddFundsAsync( + int amount, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AddFundsIn + { + Amount = amount, + }; + + return await AddFundsAsync( + useCheckout: useCheckout, + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.BillingPortal.g.cs new file mode 100644 index 00000000..32f725d2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.BillingPortal.g.cs @@ -0,0 +1,485 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_BillingPortalSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_BillingPortalSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_BillingPortalSecurityRequirement0, + }; + partial void PrepareBillingPortalArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? returnUrl, + object? session); + partial void PrepareBillingPortalRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? returnUrl, + object? session); + partial void ProcessBillingPortalResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessBillingPortalResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Billing Portal + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BillingPortalAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BillingPortalAsResponseAsync( + returnUrl: returnUrl, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Billing Portal + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> BillingPortalAsResponseAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareBillingPortalArguments( + httpClient: HttpClient, + returnUrl: ref returnUrl, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BillingPortalSecurityRequirements, + operationName: "BillingPortalAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/billing-portal", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("return_url", returnUrl) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBillingPortalRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + returnUrl: returnUrl, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBillingPortalResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BillingPortal", + methodName: "BillingPortalAsync", + pathTemplate: "\"/payment/billing-portal\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBillingPortalResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.BillingPortalOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.BillingPortalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.DeepstartApply.g.cs new file mode 100644 index 00000000..6d95d5c5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.DeepstartApply.g.cs @@ -0,0 +1,547 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_DeepstartApplySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_DeepstartApplySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_DeepstartApplySecurityRequirement0, + }; + partial void PrepareDeepstartApplyArguments( + global::System.Net.Http.HttpClient httpClient, + object? session, + global::DeepInfra.DeepStartApplicationIn request); + partial void PrepareDeepstartApplyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session, + global::DeepInfra.DeepStartApplicationIn request); + partial void ProcessDeepstartApplyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeepstartApplyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Deepstart Apply + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeepstartApplyAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeepstartApplyAsResponseAsync( + + request: request, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deepstart Apply + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeepstartApplyAsResponseAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareDeepstartApplyArguments( + httpClient: HttpClient, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeepstartApplySecurityRequirements, + operationName: "DeepstartApplyAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/deepstart/application", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeepstartApplyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeepstartApplyResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeepstartApply", + methodName: "DeepstartApplyAsync", + pathTemplate: "\"/payment/deepstart/application\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeepstartApplyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.DeepStartApplicationOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.DeepStartApplicationOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Deepstart Apply + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: pending + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeepstartApplyAsync( + string company, + string ceo, + string funding, + string foundedOn, + string website, + object? session = default, + string? id = default, + string? uid = default, + int? createdAt = default, + string? status = default, + string? deal = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.DeepStartApplicationIn + { + Id = id, + Uid = uid, + Company = company, + Ceo = ceo, + Funding = funding, + FoundedOn = foundedOn, + Website = website, + CreatedAt = createdAt, + Status = status, + Deal = deal, + }; + + return await DeepstartApplyAsync( + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetChecklist.g.cs new file mode 100644 index 00000000..886d825d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetChecklist.g.cs @@ -0,0 +1,489 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetChecklistSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetChecklistSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetChecklistSecurityRequirement0, + }; + partial void PrepareGetChecklistArguments( + global::System.Net.Http.HttpClient httpClient, + ref bool? computeOwed, + object? session); + partial void PrepareGetChecklistRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + bool? computeOwed, + object? session); + partial void ProcessGetChecklistResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetChecklistResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetChecklistAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChecklistAsResponseAsync( + computeOwed: computeOwed, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetChecklistAsResponseAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetChecklistArguments( + httpClient: HttpClient, + computeOwed: ref computeOwed, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetChecklistSecurityRequirements, + operationName: "GetChecklistAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/checklist", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("compute_owed", computeOwed?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetChecklistRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + computeOwed: computeOwed, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetChecklistResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetChecklist", + methodName: "GetChecklistAsync", + pathTemplate: "\"/payment/checklist\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetChecklistResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.Checklist.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.Checklist.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetConfig.g.cs new file mode 100644 index 00000000..9bf42f65 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.GetConfig.g.cs @@ -0,0 +1,473 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetConfigSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetConfigSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetConfigSecurityRequirement0, + }; + partial void PrepareGetConfigArguments( + global::System.Net.Http.HttpClient httpClient, + object? session); + partial void PrepareGetConfigRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session); + partial void ProcessGetConfigResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetConfigResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetConfigAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetConfigAsResponseAsync( + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetConfigAsResponseAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetConfigArguments( + httpClient: HttpClient, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetConfigSecurityRequirements, + operationName: "GetConfigAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/config", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetConfigResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetConfig", + methodName: "GetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.ListInvoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.ListInvoices.g.cs new file mode 100644 index 00000000..f8a8de9b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.ListInvoices.g.cs @@ -0,0 +1,509 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ListInvoicesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ListInvoicesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ListInvoicesSecurityRequirement0, + }; + partial void PrepareListInvoicesArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? limit, + ref string? startingAfter, + ref string? invoiceType, + object? session); + partial void PrepareListInvoicesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? limit, + string? startingAfter, + string? invoiceType, + object? session); + partial void ProcessListInvoicesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListInvoicesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListInvoicesAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListInvoicesAsResponseAsync( + limit: limit, + startingAfter: startingAfter, + invoiceType: invoiceType, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListInvoicesAsResponseAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListInvoicesArguments( + httpClient: HttpClient, + limit: ref limit, + startingAfter: ref startingAfter, + invoiceType: ref invoiceType, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListInvoicesSecurityRequirements, + operationName: "ListInvoicesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/invoices", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("starting_after", startingAfter) + .AddOptionalParameter("invoice_type", invoiceType) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListInvoicesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + limit: limit, + startingAfter: startingAfter, + invoiceType: invoiceType, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListInvoicesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListInvoices", + methodName: "ListInvoicesAsync", + pathTemplate: "\"/payment/invoices\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListInvoicesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.InvoicesOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.InvoicesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetConfig.g.cs new file mode 100644 index 00000000..32b20ac9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetConfig.g.cs @@ -0,0 +1,520 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_SetConfigSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_SetConfigSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_SetConfigSecurityRequirement0, + }; + partial void PrepareSetConfigArguments( + global::System.Net.Http.HttpClient httpClient, + object? session, + global::DeepInfra.ConfigIn request); + partial void PrepareSetConfigRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session, + global::DeepInfra.ConfigIn request); + partial void ProcessSetConfigResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSetConfigResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Set Config + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SetConfigAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SetConfigAsResponseAsync( + + request: request, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Set Config + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SetConfigAsResponseAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareSetConfigArguments( + httpClient: HttpClient, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SetConfigSecurityRequirements, + operationName: "SetConfigAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/config", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSetConfigRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessSetConfigResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetConfig", + methodName: "SetConfigAsync", + pathTemplate: "\"/payment/config\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessSetConfigResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Set Config + /// + /// + /// + /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SetConfigAsync( + object? session = default, + double? limit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ConfigIn + { + Limit = limit, + }; + + return await SetConfigAsync( + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetupTopup.g.cs new file mode 100644 index 00000000..79bfa66f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.SetupTopup.g.cs @@ -0,0 +1,529 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_SetupTopupSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_SetupTopupSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_SetupTopupSecurityRequirement0, + }; + partial void PrepareSetupTopupArguments( + global::System.Net.Http.HttpClient httpClient, + object? session, + global::DeepInfra.TopUpIn request); + partial void PrepareSetupTopupRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + object? session, + global::DeepInfra.TopUpIn request); + partial void ProcessSetupTopupResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessSetupTopupResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Setup Topup + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SetupTopupAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SetupTopupAsResponseAsync( + + request: request, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Setup Topup + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> SetupTopupAsResponseAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareSetupTopupArguments( + httpClient: HttpClient, + session: session, + request: request); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_SetupTopupSecurityRequirements, + operationName: "SetupTopupAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/topup", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareSetupTopupRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + session: session, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessSetupTopupResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "SetupTopup", + methodName: "SetupTopupAsync", + pathTemplate: "\"/payment/topup\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessSetupTopupResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Setup Topup + /// + /// + /// + /// Amount to top up in cents
+ /// Default Value: 0 + /// + /// + /// Top up threshold in cents, if balance goes below this value, top up will be triggered
+ /// Default Value: 0 + /// + /// + /// If true, top up will be triggered when balance goes below threshold
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task SetupTopupAsync( + object? session = default, + int? amount = default, + int? threshold = default, + bool? enabled = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.TopUpIn + { + Amount = amount, + Threshold = threshold, + Enabled = enabled, + }; + + return await SetupTopupAsync( + session: session, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.Usage.g.cs new file mode 100644 index 00000000..99e42f3b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.Usage.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageSecurityRequirement0, + }; + partial void PrepareUsageArguments( + global::System.Net.Http.HttpClient httpClient, + ref string from, + ref string? to, + object? session); + partial void PrepareUsageRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string from, + string? to, + object? session); + partial void ProcessUsageResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UsageAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageAsResponseAsync( + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UsageAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageArguments( + httpClient: HttpClient, + from: ref from, + to: ref to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageSecurityRequirements, + operationName: "UsageAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/usage", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUsageResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "Usage", + methodName: "UsageAsync", + pathTemplate: "\"/payment/usage\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUsageResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageApiToken.g.cs new file mode 100644 index 00000000..9e5cbd48 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageApiToken.g.cs @@ -0,0 +1,512 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageApiTokenSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageApiTokenSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageApiTokenSecurityRequirement0, + }; + partial void PrepareUsageApiTokenArguments( + global::System.Net.Http.HttpClient httpClient, + ref string apiToken, + ref string from, + ref string? to, + object? session); + partial void PrepareUsageApiTokenRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string apiToken, + string from, + string? to, + object? session); + partial void ProcessUsageApiTokenResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageApiTokenResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UsageApiTokenAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageApiTokenAsResponseAsync( + apiToken: apiToken, + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UsageApiTokenAsResponseAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageApiTokenArguments( + httpClient: HttpClient, + apiToken: ref apiToken, + from: ref from, + to: ref to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageApiTokenSecurityRequirements, + operationName: "UsageApiTokenAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/payment/usage/{apiToken}", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageApiTokenRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + apiToken: apiToken!, + from: from!, + to: to, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUsageApiTokenResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageApiToken", + methodName: "UsageApiTokenAsync", + pathTemplate: "$\"/payment/usage/{apiToken}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUsageApiTokenResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageRent.g.cs new file mode 100644 index 00000000..f1711a4b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageRent.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageRentSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageRentSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageRentSecurityRequirement0, + }; + partial void PrepareUsageRentArguments( + global::System.Net.Http.HttpClient httpClient, + ref int from, + int? to, + object? session); + partial void PrepareUsageRentRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int from, + int? to, + object? session); + partial void ProcessUsageRentResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageRentResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UsageRentAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageRentAsResponseAsync( + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UsageRentAsResponseAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageRentArguments( + httpClient: HttpClient, + from: ref from, + to: to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageRentSecurityRequirements, + operationName: "UsageRentAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/usage/rent", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from.ToString()!) + .AddOptionalParameter("to", to?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageRentRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUsageRentResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageRent", + methodName: "UsageRentAsync", + pathTemplate: "\"/payment/usage/rent\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUsageRentResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageRentOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.UsageRentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageTokens.g.cs new file mode 100644 index 00000000..974d3cc5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.UsageTokens.g.cs @@ -0,0 +1,503 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class BillingClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_UsageTokensSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_UsageTokensSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_UsageTokensSecurityRequirement0, + }; + partial void PrepareUsageTokensArguments( + global::System.Net.Http.HttpClient httpClient, + ref string from, + ref string? to, + object? session); + partial void PrepareUsageTokensRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string from, + string? to, + object? session); + partial void ProcessUsageTokensResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUsageTokensResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UsageTokensAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UsageTokensAsResponseAsync( + from: from, + to: to, + session: session, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> UsageTokensAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareUsageTokensArguments( + httpClient: HttpClient, + from: ref from, + to: ref to, + session: session); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UsageTokensSecurityRequirements, + operationName: "UsageTokensAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/payment/usage/tokens", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("from", from) + .AddOptionalParameter("to", to) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + var __cookies = new global::System.Collections.Generic.List(); + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __session = session; + if (__session is not null) + { + __cookies.Add("session=" + (__session.ToString() ?? string.Empty)); + } + + if (__cookies.Count > 0) + { + __httpRequest.Headers.TryAddWithoutValidation("Cookie", string.Join("; ", __cookies)); + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUsageTokensRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + from: from!, + to: to, + session: session); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUsageTokensResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UsageTokens", + methodName: "UsageTokensAsync", + pathTemplate: "\"/payment/usage/tokens\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUsageTokensResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs new file mode 100644 index 00000000..d677c26b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.BillingClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Payment methods, usage tracking, and billing.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class BillingClient : global::DeepInfra.IBillingClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the BillingClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public BillingClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the BillingClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public BillingClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the BillingClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public BillingClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs new file mode 100644 index 00000000..e224f2ab --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessages.g.cs @@ -0,0 +1,612 @@ + +#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? 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? 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? 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, + 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? 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, + 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 (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, + 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 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// 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? xiApiKey = default, + string? xApiKey = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? system = default, + global::System.Collections.Generic.IList? stopSequences = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + int? topK = default, + object? metadata = default, + global::System.Collections.Generic.IList? tools = default, + object? toolChoice = default, + global::DeepInfra.AnthropicThinkingConfig? thinking = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.AnthropicMessagesIn + { + Model = model, + MaxTokens = maxTokens, + Messages = messages, + System = system, + StopSequences = stopSequences, + Stream = stream, + Temperature = temperature, + TopP = topP, + TopK = topK, + Metadata = metadata, + Tools = tools, + ToolChoice = toolChoice, + Thinking = thinking, + }; + + return await AnthropicMessagesAsync( + anthropicVersion: anthropicVersion, + anthropicBeta: anthropicBeta, + 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.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.AnthropicMessagesCountTokens.g.cs new file mode 100644 index 00000000..677f6f54 --- /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..9839ea4a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.OpenaiChatCompletions.g.cs @@ -0,0 +1,682 @@ + +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// conversation messages: (user,assistant,tool)*,user including one system message anywhere + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// The maximum number of tokens to generate in the chat completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// A list of tools the model may call. Currently, only functions are supported as a tool. + /// + /// + /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. + /// + /// + /// streaming options + /// + /// + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// + /// + /// Reasoning configuration. + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Chat template kwargs. + /// + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( + string model, + global::System.Collections.Generic.IList> messages, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? stop = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + int? n = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.IList? tools = default, + global::DeepInfra.AnyOf? toolChoice = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + bool? logprobs = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, + global::DeepInfra.ChatReasoningSettings? reasoning = default, + string? promptCacheKey = default, + object? chatTemplateKwargs = default, + bool? continueFinalMessage = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAIChatCompletionsIn + { + ServiceTier = serviceTier, + Model = model, + Messages = messages, + Stream = stream, + Temperature = temperature, + TopP = topP, + MinP = minP, + TopK = topK, + MaxTokens = maxTokens, + Stop = stop, + StopTokenIds = stopTokenIds, + N = n, + PresencePenalty = presencePenalty, + FrequencyPenalty = frequencyPenalty, + Tools = tools, + ToolChoice = toolChoice, + ResponseFormat = responseFormat, + RepetitionPenalty = repetitionPenalty, + User = user, + Seed = seed, + Logprobs = logprobs, + StreamOptions = streamOptions, + ReasoningEffort = reasoningEffort, + Reasoning = reasoning, + PromptCacheKey = promptCacheKey, + ChatTemplateKwargs = chatTemplateKwargs, + ContinueFinalMessage = continueFinalMessage, + }; + + return await OpenaiChatCompletionsAsync( + xDeepinfraSource: xDeepinfraSource, + xiApiKey: xiApiKey, + 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..43f1ad72 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ChatCompletionsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ChatCompletionsClient : global::DeepInfra.IChatCompletionsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ChatCompletionsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ChatCompletionsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ChatCompletionsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ChatCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ChatCompletionsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ChatCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreate.g.cs new file mode 100644 index 00000000..a410f428 --- /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..d49788ba --- /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..15458e95 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployCreateLlm.g.cs @@ -0,0 +1,689 @@ + +#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 + /// + /// + /// 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 + /// + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. + /// + /// + /// Apply a DeepInfra preset (base_model deploys only). + /// + /// Per-request overrides 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, + int? maxBatchSize = default, + global::DeepInfra.HFWeights? hf = default, + string? baseModel = default, + string? containerImage = default, + global::DeepInfra.ScaleSettings? settings = default, + global::System.Collections.Generic.IList? extraArgs = default, + global::DeepInfra.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, + MaxBatchSize = maxBatchSize, + 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..b2470f72 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployDelete.g.cs @@ -0,0 +1,526 @@ + +#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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__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..10573063 --- /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..20d2001b --- /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..fac4a87f --- /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,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,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..3a072640 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployLlmPresets.g.cs @@ -0,0 +1,518 @@ + +#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, + global::DeepInfra.DeployGPUs? gpu, + ref string? engine, + 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? 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-tested preset deploy configs for ``hf_repo_id`` (HF org/name), for
+ /// the deploy dashboard to pre-fill. An empty list — the common case — means none.
+ /// Omit ``engine`` to get presets across all engines. + ///
+ /// + /// + /// + /// + /// + /// Per-request overrides 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? 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, + xiApiKey: xiApiKey, + xApiKey: xApiKey, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Deploy Llm Presets
+ /// DeepInfra-tested preset deploy configs for ``hf_repo_id`` (HF org/name), for
+ /// the deploy dashboard to pre-fill. An empty list — the common case — means none.
+ /// Omit ``engine`` to get presets across all engines. + ///
+ /// + /// + /// + /// + /// + /// Per-request overrides 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? 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: gpu, + engine: ref engine, + 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) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.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, + 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..5d2d4ece --- /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..ba16318d --- /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.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStart.g.cs new file mode 100644 index 00000000..d32bbea0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStart.g.cs @@ -0,0 +1,565 @@ + +#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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__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..8e87decd --- /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..f327cf24 --- /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..13a518c2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployStop.g.cs @@ -0,0 +1,565 @@ + +#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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__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..62476ba2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.DeployUpdate.g.cs @@ -0,0 +1,661 @@ + +#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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__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..72d22989 --- /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..bfbf70a8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.DedicatedModelsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Deploy and manage private model instances with autoscaling.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class DedicatedModelsClient : global::DeepInfra.IDedicatedModelsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the DedicatedModelsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public DedicatedModelsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the DedicatedModelsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public DedicatedModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the DedicatedModelsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public DedicatedModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountEmailValues.g.cs deleted file mode 100644 index 133652e9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountEmailValues.g.cs +++ /dev/null @@ -1,256 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountEmailValuesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareAccountEmailValuesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessAccountEmailValuesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountEmailValuesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Email Values - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountEmailValuesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareAccountEmailValuesArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/emails", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountEmailValuesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountEmailValuesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountEmailValuesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.EmailsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.EmailsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountGpuLimit.g.cs deleted file mode 100644 index 4a7183f6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountGpuLimit.g.cs +++ /dev/null @@ -1,256 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountGpuLimitArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareAccountGpuLimitRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessAccountGpuLimitResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountGpuLimitResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Gpu Limit - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountGpuLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareAccountGpuLimitArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/gpu_limit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountGpuLimitRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountGpuLimitResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountGpuLimitResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.GpuLimitOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.GpuLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountRateLimit.g.cs deleted file mode 100644 index 8f06b093..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountRateLimit.g.cs +++ /dev/null @@ -1,256 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountRateLimitArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareAccountRateLimitRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessAccountRateLimitResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountRateLimitResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Rate Limit - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountRateLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareAccountRateLimitArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/rate_limit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountRateLimitRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountRateLimitResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountRateLimitResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.RateLimitOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.RateLimitOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountUpdateDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountUpdateDetails.g.cs deleted file mode 100644 index e0838050..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AccountUpdateDetails.g.cs +++ /dev/null @@ -1,380 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAccountUpdateDetailsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.MeIn request); - partial void PrepareAccountUpdateDetailsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.MeIn request); - partial void ProcessAccountUpdateDetailsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAccountUpdateDetailsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Account Update Details - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - - global::DeepInfra.MeIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAccountUpdateDetailsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAccountUpdateDetailsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAccountUpdateDetailsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAccountUpdateDetailsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Account Update Details - /// - /// - /// - /// Personal name - /// - /// - /// First name of the user - /// - /// - /// Last name of the user - /// - /// - /// Country of the user - /// - /// - /// - /// - /// Company name - /// - /// - /// Company website address - /// - /// - /// Job title of the user, e.g. 'Software Engineer' - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// - /// Short description of the use case for the account - /// - /// - /// Short description of how the user found out about DeepInfra - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - string? xiApiKey = default, - string? name = default, - string? firstName = default, - string? lastName = default, - string? country = default, - string? email = default, - bool? isBusinessAccount = default, - string? company = default, - string? website = default, - string? title = default, - string? displayName = default, - string? useCase = default, - string? attribution = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.MeIn - { - Name = name, - FirstName = firstName, - LastName = lastName, - Country = country, - Email = email, - IsBusinessAccount = isBusinessAccount, - Company = company, - Website = website, - Title = title, - DisplayName = displayName, - UseCase = useCase, - Attribution = attribution, - }; - - return await AccountUpdateDetailsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs deleted file mode 100644 index 9fd77666..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.cs +++ /dev/null @@ -1,247 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAddFundsArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.AddFundsIn request); - partial void PrepareAddFundsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.AddFundsIn request); - partial void ProcessAddFundsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAddFundsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Add Funds - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AddFundsAsync( - - global::DeepInfra.AddFundsIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAddFundsArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/funds", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAddFundsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAddFundsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAddFundsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Add Funds - /// - /// - /// - /// Amount to add in cents - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AddFundsAsync( - int amount, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.AddFundsIn - { - Amount = amount, - }; - - return await AddFundsAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessages.g.cs deleted file mode 100644 index cf2d9c1a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessages.g.cs +++ /dev/null @@ -1,330 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAnthropicMessagesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xApiKey, - ref string? anthropicVersion, - ref string? anthropicBeta, - ref string? xDeepinfraSource, - global::DeepInfra.AnthropicMessagesIn request); - partial void PrepareAnthropicMessagesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xApiKey, - string? anthropicVersion, - string? anthropicBeta, - string? xDeepinfraSource, - global::DeepInfra.AnthropicMessagesIn request); - partial void ProcessAnthropicMessagesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAnthropicMessagesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesAsync( - - global::DeepInfra.AnthropicMessagesIn request, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAnthropicMessagesArguments( - httpClient: HttpClient, - xApiKey: ref xApiKey, - anthropicVersion: ref anthropicVersion, - anthropicBeta: ref anthropicBeta, - xDeepinfraSource: ref xDeepinfraSource, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/anthropic/v1/messages", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); - } - if (anthropicVersion != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-version", anthropicVersion.ToString()); - } - if (anthropicBeta != default) - { - __httpRequest.Headers.TryAddWithoutValidation("anthropic-beta", anthropicBeta.ToString()); - } - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAnthropicMessagesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xApiKey: xApiKey, - anthropicVersion: anthropicVersion, - anthropicBeta: anthropicBeta, - xDeepinfraSource: xDeepinfraSource, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAnthropicMessagesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAnthropicMessagesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: false - /// - /// - /// Default Value: 1F - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? stopSequences = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - int? topK = default, - object? metadata = default, - global::System.Collections.Generic.IList? tools = default, - object? toolChoice = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.AnthropicMessagesIn - { - Model = model, - MaxTokens = maxTokens, - Messages = messages, - System = system, - StopSequences = stopSequences, - Stream = stream, - Temperature = temperature, - TopP = topP, - TopK = topK, - Metadata = metadata, - Tools = tools, - ToolChoice = toolChoice, - Thinking = thinking, - }; - - return await AnthropicMessagesAsync( - xApiKey: xApiKey, - anthropicVersion: anthropicVersion, - anthropicBeta: anthropicBeta, - xDeepinfraSource: xDeepinfraSource, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessagesCountTokens.g.cs deleted file mode 100644 index af78604b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AnthropicMessagesCountTokens.g.cs +++ /dev/null @@ -1,266 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareAnthropicMessagesCountTokensArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xApiKey, - global::DeepInfra.AnthropicTokenCountRequest request); - partial void PrepareAnthropicMessagesCountTokensRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xApiKey, - global::DeepInfra.AnthropicTokenCountRequest request); - partial void ProcessAnthropicMessagesCountTokensResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessAnthropicMessagesCountTokensResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - - global::DeepInfra.AnthropicTokenCountRequest request, - string? xApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareAnthropicMessagesCountTokensArguments( - httpClient: HttpClient, - xApiKey: ref xApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/anthropic/v1/messages/count_tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-api-key", xApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareAnthropicMessagesCountTokensRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xApiKey: xApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessAnthropicMessagesCountTokensResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessAnthropicMessagesCountTokensResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - object? toolChoice = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.AnthropicTokenCountRequest - { - Model = model, - Messages = messages, - System = system, - Tools = tools, - Thinking = thinking, - ToolChoice = toolChoice, - }; - - return await AnthropicMessagesCountTokensAsync( - xApiKey: xApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs index 5bd69a32..a760d462 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Authorizations.Bearer.g.cs @@ -5,16 +5,27 @@ namespace DeepInfra { public sealed partial class DeepInfraClient { + /// public void AuthorizeUsingBearer( string apiKey) { apiKey = apiKey ?? throw new global::System.ArgumentNullException(nameof(apiKey)); - Authorizations.Clear(); + for (var i = Authorizations.Count - 1; i >= 0; i--) + { + var __authorization = Authorizations[i]; + if (__authorization.Type == "Http" && + __authorization.Name == "Bearer") + { + Authorizations.RemoveAt(i); + } + } + Authorizations.Add(new global::DeepInfra.EndPointAuthorization { Type = "Http", + SchemeId = "HttpBearer", Location = "Header", Name = "Bearer", Value = apiKey, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs deleted file mode 100644 index dd970589..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.cs +++ /dev/null @@ -1,221 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareBillingPortalArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? returnUrl, - object? session); - partial void PrepareBillingPortalRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? returnUrl, - object? session); - partial void ProcessBillingPortalResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessBillingPortalResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Billing Portal - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task BillingPortalAsync( - string? returnUrl = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareBillingPortalArguments( - httpClient: HttpClient, - returnUrl: ref returnUrl, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/billing-portal", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("return_url", returnUrl) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareBillingPortalRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - returnUrl: returnUrl, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessBillingPortalResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessBillingPortalResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.BillingPortalOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.BillingPortalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CliVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CliVersion.g.cs deleted file mode 100644 index f14aae33..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CliVersion.g.cs +++ /dev/null @@ -1,211 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCliVersionArguments( - global::System.Net.Http.HttpClient httpClient, - ref string version); - partial void PrepareCliVersionRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string version); - partial void ProcessCliVersionResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCliVersionResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Cli Version - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CliVersionAsync( - string version, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareCliVersionArguments( - httpClient: HttpClient, - version: ref version); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/cli/version", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCliVersionRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - version: version); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCliVersionResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCliVersionResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs index bc94b239..a8454b5b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Constructors.Bearer.g.cs @@ -6,6 +6,7 @@ namespace DeepInfra public sealed partial class DeepInfraClient { /// + public DeepInfraClient( string apiKey, global::System.Net.Http.HttpClient? httpClient = null, @@ -25,5 +26,6 @@ partial void Authorizing( ref string apiKey); partial void Authorized( global::System.Net.Http.HttpClient client); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsDelete.g.cs deleted file mode 100644 index caf72500..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsDelete.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string containerId, - ref string? xiApiKey); - partial void PrepareContainerRentalsDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string containerId, - string? xiApiKey); - partial void ProcessContainerRentalsDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Delete - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsDeleteAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsDeleteArguments( - httpClient: HttpClient, - containerId: ref containerId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/containers/{containerId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - containerId: containerId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGet.g.cs deleted file mode 100644 index c75b1752..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGet.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsGetArguments( - global::System.Net.Http.HttpClient httpClient, - ref string containerId, - ref string? xiApiKey); - partial void PrepareContainerRentalsGetRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string containerId, - string? xiApiKey); - partial void ProcessContainerRentalsGetResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsGetResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Get - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsGetAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsGetArguments( - httpClient: HttpClient, - containerId: ref containerId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/containers/{containerId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsGetRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - containerId: containerId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsGetResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsGetResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ContainerRentalOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ContainerRentalOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGetParams.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGetParams.g.cs deleted file mode 100644 index 27643614..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsGetParams.g.cs +++ /dev/null @@ -1,252 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsGetParamsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareContainerRentalsGetParamsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessContainerRentalsGetParamsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsGetParamsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Get Params - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsGetParamsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsGetParamsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers/params", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsGetParamsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsGetParamsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsGetParamsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsList.g.cs deleted file mode 100644 index adab7199..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsList.g.cs +++ /dev/null @@ -1,306 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsListArguments( - global::System.Net.Http.HttpClient httpClient, - ref global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, - ref string? xiApiKey); - partial void PrepareContainerRentalsListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - global::DeepInfra.ContainerRentalsListV1ContainersGetState? state, - string? xiApiKey); - partial void ProcessContainerRentalsListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals List - /// - /// - /// whether to return active or inactive containers
- /// Default Value: active - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ContainerRentalsListAsync( - global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsListArguments( - httpClient: HttpClient, - state: ref state, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("state", state?.ToValueString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - state: state, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsStart.g.cs deleted file mode 100644 index 9afcf147..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsStart.g.cs +++ /dev/null @@ -1,386 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsStartArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.ContainerRentalStartIn request); - partial void PrepareContainerRentalsStartRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.ContainerRentalStartIn request); - partial void ProcessContainerRentalsStartResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsStartResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Start - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - - global::DeepInfra.ContainerRentalStartIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsStartArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsStartRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsStartResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Too Many Requests - if ((int)__response.StatusCode == 429) - { - string? __content_429 = null; - global::System.Exception? __exception_429 = null; - global::DeepInfra.DeepError? __value_429 = null; - try - { - if (ReadResponseAsString) - { - __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); - } - else - { - __content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_429 = global::DeepInfra.DeepError.FromJson(__content_429, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_429 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsStartResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ContainerRentalStartOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ContainerRentalStartOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Container Rentals Start - /// - /// - /// - /// Container Name - /// - /// - /// GPU config - /// - /// - /// Container Image - /// - /// - /// Cloud Init User Data - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - string name, - string gpuConfig, - string containerImage, - string cloudInitUserData, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ContainerRentalStartIn - { - Name = name, - GpuConfig = gpuConfig, - ContainerImage = containerImage, - CloudInitUserData = cloudInitUserData, - }; - - return await ContainerRentalsStartAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsUpdate.g.cs deleted file mode 100644 index e721f0d5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ContainerRentalsUpdate.g.cs +++ /dev/null @@ -1,338 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareContainerRentalsUpdateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string containerId, - ref string? xiApiKey, - global::DeepInfra.ContainerRentalUpdateIn request); - partial void PrepareContainerRentalsUpdateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string containerId, - string? xiApiKey, - global::DeepInfra.ContainerRentalUpdateIn request); - partial void ProcessContainerRentalsUpdateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessContainerRentalsUpdateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Container Rentals Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - - global::DeepInfra.ContainerRentalUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareContainerRentalsUpdateArguments( - httpClient: HttpClient, - containerId: ref containerId, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/containers/{containerId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareContainerRentalsUpdateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - containerId: containerId, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessContainerRentalsUpdateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessContainerRentalsUpdateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Container Rentals Update - /// - /// - /// - /// - /// Container Name - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ContainerRentalUpdateIn - { - Name = name, - }; - - return await ContainerRentalsUpdateAsync( - containerId: containerId, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateApiToken.g.cs deleted file mode 100644 index a77b1a9e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateApiToken.g.cs +++ /dev/null @@ -1,293 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.ApiTokenIn request); - partial void PrepareCreateApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.ApiTokenIn request); - partial void ProcessCreateApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiTokenAsync( - - global::DeepInfra.ApiTokenIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateApiTokenArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/api-tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ApiToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ApiToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateApiTokenAsync( - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ApiTokenIn - { - Name = name, - }; - - return await CreateApiTokenAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateLora.g.cs deleted file mode 100644 index 02e26c76..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateLora.g.cs +++ /dev/null @@ -1,267 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.CreateLoraApiRequest request); - partial void PrepareCreateLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.CreateLoraApiRequest request); - partial void ProcessCreateLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Lora - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateLoraAsync( - - global::DeepInfra.CreateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateLoraArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/lora/create", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Lora - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateLoraAsync( - string baseModel, - string loraName, - global::DeepInfra.SourceModel source, - bool @private, - string? xiApiKey = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.CreateLoraApiRequest - { - BaseModel = baseModel, - LoraName = loraName, - Source = source, - Private = @private, - Description = description, - }; - - return await CreateLoraAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch.g.cs deleted file mode 100644 index 9c58b961..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateOpenaiBatchArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void PrepareCreateOpenaiBatchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void ProcessCreateOpenaiBatchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateOpenaiBatchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateOpenaiBatchArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/batches", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateOpenaiBatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateOpenaiBatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateOpenaiBatchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIBatch.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIBatchesIn - { - InputFileId = inputFileId, - Endpoint = endpoint, - CompletionWindow = completionWindow, - Metadata = metadata, - }; - - return await CreateOpenaiBatchAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch2.g.cs deleted file mode 100644 index d401d0e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateOpenaiBatch2.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateOpenaiBatch2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void PrepareCreateOpenaiBatch2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIBatchesIn request); - partial void ProcessCreateOpenaiBatch2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateOpenaiBatch2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateOpenaiBatch2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/batches", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateOpenaiBatch2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateOpenaiBatch2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateOpenaiBatch2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIBatch.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIBatch.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIBatchesIn - { - InputFileId = inputFileId, - Endpoint = endpoint, - CompletionWindow = completionWindow, - Metadata = metadata, - }; - - return await CreateOpenaiBatch2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateScopedJwt.g.cs deleted file mode 100644 index e3e72643..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateScopedJwt.g.cs +++ /dev/null @@ -1,275 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateScopedJwtArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.ScopedJWTIn request); - partial void PrepareCreateScopedJwtRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.ScopedJWTIn request); - partial void ProcessCreateScopedJwtResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateScopedJwtResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateScopedJwtAsync( - - global::DeepInfra.ScopedJWTIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateScopedJwtArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/scoped-jwt", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateScopedJwtRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateScopedJwtResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateScopedJwtResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ScopedJWTOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ScopedJWTOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Scoped Jwt - /// - /// - /// - /// - /// allow inference only to the specified model names - /// - /// - /// how many seconds in the future should the token be valid for - /// - /// - /// unix timestamp when the token should expire - /// - /// - /// only allow spending that much USD until the token becomes invalid - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateScopedJwtAsync( - string apiKeyName, - string? xiApiKey = default, - global::System.Collections.Generic.IList? models = default, - int? expiresDelta = default, - int? expiresAt = default, - double? spendingLimit = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ScopedJWTIn - { - ApiKeyName = apiKeyName, - Models = models, - ExpiresDelta = expiresDelta, - ExpiresAt = expiresAt, - SpendingLimit = spendingLimit, - }; - - return await CreateScopedJwtAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateSshKey.g.cs deleted file mode 100644 index 50c324ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateSshKey.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateSshKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.SshKeyIn request); - partial void PrepareCreateSshKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.SshKeyIn request); - partial void ProcessCreateSshKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateSshKeyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateSshKeyAsync( - - global::DeepInfra.SshKeyIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateSshKeyArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/ssh_keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateSshKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateSshKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateSshKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.SshKeyOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.SshKeyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Ssh Key - /// - /// - /// - /// SSH Key name - /// - /// - /// SSH Key content - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateSshKeyAsync( - string name, - string key, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.SshKeyIn - { - Name = name, - Key = key, - }; - - return await CreateSshKeyAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateVoice.g.cs deleted file mode 100644 index f5edf120..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.CreateVoice.g.cs +++ /dev/null @@ -1,322 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareCreateVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); - partial void PrepareCreateVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request); - partial void ProcessCreateVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessCreateVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateVoiceAsync( - - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareCreateVoiceArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/voices/add", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Name}"), - name: "\"name\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Description}"), - name: "\"description\""); - for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) - { - var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); - __httpRequestContent.Add( - content: __contentFiles, - name: "\"files\"", - fileName: $"\"file{__iFiles}.bin\""); - if (__contentFiles.Headers.ContentDisposition != null) - { - __contentFiles.Headers.ContentDisposition.FileNameStar = null; - } - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareCreateVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessCreateVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessCreateVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task CreateVoiceAsync( - string name, - string description, - global::System.Collections.Generic.IList files, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyCreateVoiceV1VoicesAddPost - { - Name = name, - Description = description, - Files = files, - }; - - return await CreateVoiceAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs deleted file mode 100644 index 4534e9bd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.cs +++ /dev/null @@ -1,278 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeepstartApplyArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.DeepStartApplicationIn request); - partial void PrepareDeepstartApplyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.DeepStartApplicationIn request); - partial void ProcessDeepstartApplyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeepstartApplyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deepstart Apply - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeepstartApplyAsync( - - global::DeepInfra.DeepStartApplicationIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeepstartApplyArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/deepstart/application", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeepstartApplyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeepstartApplyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeepstartApplyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeepStartApplicationOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeepStartApplicationOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deepstart Apply - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: pending - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeepstartApplyAsync( - string company, - string ceo, - string funding, - string foundedOn, - string website, - object? session = default, - string? id = default, - string? uid = default, - int? createdAt = default, - string? status = default, - string? deal = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeepStartApplicationIn - { - Id = id, - Uid = uid, - Company = company, - Ceo = ceo, - Funding = funding, - FoundedOn = foundedOn, - Website = website, - CreatedAt = createdAt, - Status = status, - Deal = deal, - }; - - return await DeepstartApplyAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteAccount.g.cs deleted file mode 100644 index 2bb57d09..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteAccount.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteAccountArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareDeleteAccountRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessDeleteAccountResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteAccountResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Account - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteAccountAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteAccountArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteAccountRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteAccountResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteAccountResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Me.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Me.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteApiToken.g.cs deleted file mode 100644 index 63f40260..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteApiToken.g.cs +++ /dev/null @@ -1,258 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string? xiApiKey); - partial void PrepareDeleteApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string? xiApiKey); - partial void ProcessDeleteApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteApiTokenArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/api-tokens/{apiToken}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLora.g.cs deleted file mode 100644 index d0d11268..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLora.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey); - partial void PrepareDeleteLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey); - partial void ProcessDeleteLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Lora - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteLoraArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLoraModel.g.cs deleted file mode 100644 index 4b745619..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteLoraModel.g.cs +++ /dev/null @@ -1,258 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteLoraModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraModelName, - ref string? xiApiKey); - partial void PrepareDeleteLoraModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraModelName, - string? xiApiKey); - partial void ProcessDeleteLoraModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteLoraModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteLoraModelAsync( - string loraModelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteLoraModelArguments( - httpClient: HttpClient, - loraModelName: ref loraModelName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/lora-model/{loraModelName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteLoraModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraModelName: loraModelName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteLoraModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteLoraModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteSshKey.g.cs deleted file mode 100644 index 36dad29c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteSshKey.g.cs +++ /dev/null @@ -1,258 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteSshKeyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string sshKeyId, - ref string? xiApiKey); - partial void PrepareDeleteSshKeyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string sshKeyId, - string? xiApiKey); - partial void ProcessDeleteSshKeyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteSshKeyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteSshKeyAsync( - string sshKeyId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteSshKeyArguments( - httpClient: HttpClient, - sshKeyId: ref sshKeyId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/ssh_keys/{sshKeyId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteSshKeyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - sshKeyId: sshKeyId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteSshKeyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteSshKeyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteVoice.g.cs deleted file mode 100644 index 193a105f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeleteVoice.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeleteVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? xiApiKey); - partial void PrepareDeleteVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? xiApiKey); - partial void ProcessDeleteVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeleteVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Delete Voice - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeleteVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeleteVoiceArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/voices/{voiceId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeleteVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeleteVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeleteVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreate.g.cs deleted file mode 100644 index b15df214..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreate.g.cs +++ /dev/null @@ -1,382 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployCreateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.DeployModelIn request); - partial void PrepareDeployCreateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.DeployModelIn request); - partial void ProcessDeployCreateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployCreateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Create - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateAsync( - - global::DeepInfra.DeployModelIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployCreateArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/deploy", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployCreateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployCreateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployCreateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Create - /// - /// - /// - /// namespace for the model name
- /// Default Value: cnt - /// - /// - /// model name in specified provider - /// - /// - /// A specific revision, if left empty uses the last one - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateAsync( - string modelName, - string? xiApiKey = default, - global::DeepInfra.ModelProvider? provider = default, - string? version = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeployModelIn - { - Provider = provider, - ModelName = modelName, - Version = version, - }; - - return await DeployCreateAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateHf.g.cs deleted file mode 100644 index f475b467..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateHf.g.cs +++ /dev/null @@ -1,376 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployCreateHfArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.HFModel request); - partial void PrepareDeployCreateHfRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.HFModel request); - partial void ProcessDeployCreateHfResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployCreateHfResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Create Hf - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateHfAsync( - - global::DeepInfra.HFModel request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployCreateHfArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/hf/", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployCreateHfRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployCreateHfResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployCreateHfResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployResult.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployResult.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Create Hf - /// - /// - /// - /// Model Id from huggingface - /// - /// - /// Task - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateHfAsync( - string modelName, - string? xiApiKey = default, - string? task = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.HFModel - { - ModelName = modelName, - Task = task, - }; - - return await DeployCreateHfAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateLlm.g.cs deleted file mode 100644 index 57b1f547..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployCreateLlm.g.cs +++ /dev/null @@ -1,371 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployCreateLlmArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.DeployLLMIn request); - partial void PrepareDeployCreateLlmRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.DeployLLMIn request); - partial void ProcessDeployCreateLlmResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployCreateLlmResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Create Llm - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateLlmAsync( - - global::DeepInfra.DeployLLMIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployCreateLlmArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/llm", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployCreateLlmRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployCreateLlmResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Payment Required - if ((int)__response.StatusCode == 402) - { - string? __content_402 = null; - global::System.Exception? __exception_402 = null; - global::DeepInfra.DeepError? __value_402 = null; - try - { - if (ReadResponseAsString) - { - __content_402 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); - } - else - { - __content_402 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_402 = global::DeepInfra.DeepError.FromJson(__content_402, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_402 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_402 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_402, - statusCode: __response.StatusCode) - { - ResponseBody = __content_402, - ResponseObject = __value_402, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unprocessable Entity - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.DeepError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.DeepError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployCreateLlmResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Create Llm - /// - /// - /// - /// model name for deepinfra (username/mode-name format) - /// - /// - /// The type of GPU the deployment is running on - /// - /// - /// Number of GPUs used by one instance
- /// Default Value: 1 - /// - /// - /// Maximum number of concurrent requests
- /// Default Value: 96 - /// - /// - /// - /// Base public model - /// - /// - /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) - /// - /// - /// - /// Extra command line arguments for custom deployments - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployCreateLlmAsync( - string modelName, - global::DeepInfra.DeployGPUs gpu, - string? xiApiKey = default, - int? numGpus = default, - int? maxBatchSize = default, - global::DeepInfra.HFWeights? hf = default, - string? baseModel = default, - string? containerImage = default, - global::DeepInfra.ScaleSettings? settings = default, - global::System.Collections.Generic.IList? extraArgs = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeployLLMIn - { - ModelName = modelName, - Gpu = gpu, - NumGpus = numGpus, - MaxBatchSize = maxBatchSize, - Hf = hf, - BaseModel = baseModel, - ContainerImage = containerImage, - Settings = settings, - ExtraArgs = extraArgs, - }; - - return await DeployCreateLlmAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDelete.g.cs deleted file mode 100644 index 1a779acf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDelete.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Delete - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployDeleteAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployDeleteArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployDelete.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployDelete.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDetailedStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDetailedStats.g.cs deleted file mode 100644 index a6700064..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployDetailedStats.g.cs +++ /dev/null @@ -1,321 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployDetailedStatsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string from, - ref string? to, - ref string? xiApiKey); - partial void PrepareDeployDetailedStatsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string from, - string? to, - string? xiApiKey); - partial void ProcessDeployDetailedStatsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployDetailedStatsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Detailed Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployDetailedStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployDetailedStatsArguments( - httpClient: HttpClient, - deployId: ref deployId, - from: ref from, - to: ref to, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/stats2", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployDetailedStatsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - from: from, - to: to, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployDetailedStatsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Gone - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::DeepInfra.DeepError? __value_410 = null; - try - { - if (ReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - statusCode: __response.StatusCode) - { - ResponseBody = __content_410, - ResponseObject = __value_410, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployDetailedStatsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DetailedDeploymentStatsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DetailedDeploymentStatsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployGpuAvailability.g.cs deleted file mode 100644 index 5dbadbd6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployGpuAvailability.g.cs +++ /dev/null @@ -1,234 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployGpuAvailabilityArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? source, - ref string? baseModel, - ref string? xiApiKey); - partial void PrepareDeployGpuAvailabilityRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? source, - string? baseModel, - string? xiApiKey); - partial void ProcessDeployGpuAvailabilityResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployGpuAvailabilityResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployGpuAvailabilityArguments( - httpClient: HttpClient, - source: ref source, - baseModel: ref baseModel, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/llm/gpu_availability", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("source", source) - .AddOptionalParameter("base_model", baseModel) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployGpuAvailabilityRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - source: source, - baseModel: baseModel, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployGpuAvailabilityResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployGpuAvailabilityResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployGPUAvailability.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployGPUAvailability.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployList2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployList2.g.cs deleted file mode 100644 index eeec4628..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployList2.g.cs +++ /dev/null @@ -1,267 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployList2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? status, - ref string? xiApiKey); - partial void PrepareDeployList2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? status, - string? xiApiKey); - partial void ProcessDeployList2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployList2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy List - /// - /// - /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> DeployList2Async( - string? status = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployList2Arguments( - httpClient: HttpClient, - status: ref status, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/list", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("status", status) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployList2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - status: status, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployList2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployList2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStart.g.cs deleted file mode 100644 index e31ae6d4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStart.g.cs +++ /dev/null @@ -1,301 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStartArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployStartRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployStartResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStartResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Start
- /// Start a stopped deployment. Re-creates pods via auto-scaling. - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStartAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStartArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/start", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStartRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStartResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStartResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStats.g.cs deleted file mode 100644 index 54e552ec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStats.g.cs +++ /dev/null @@ -1,321 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStatsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string from, - ref string? to, - ref string? xiApiKey); - partial void PrepareDeployStatsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string from, - string? to, - string? xiApiKey); - partial void ProcessDeployStatsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStatsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStatsArguments( - httpClient: HttpClient, - deployId: ref deployId, - from: ref from, - to: ref to, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/stats", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStatsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - from: from, - to: to, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStatsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Gone - if ((int)__response.StatusCode == 410) - { - string? __content_410 = null; - global::System.Exception? __exception_410 = null; - global::DeepInfra.DeepError? __value_410 = null; - try - { - if (ReadResponseAsString) - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - else - { - __content_410 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_410 = global::DeepInfra.DeepError.FromJson(__content_410, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_410 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_410 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_410, - statusCode: __response.StatusCode) - { - ResponseBody = __content_410, - ResponseObject = __value_410, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStatsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentStatsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentStatsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStatus.g.cs deleted file mode 100644 index dd51fd53..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStatus.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStatusArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployStatusRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployStatusResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStatusResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Status - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStatusAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStatusArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStatusResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStop.g.cs deleted file mode 100644 index 1c0008b8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployStop.g.cs +++ /dev/null @@ -1,301 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployStopArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareDeployStopRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessDeployStopResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployStopResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Stop
- /// Stop a running deployment. Terminates pods. Can be restarted later. - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployStopAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeployStopArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}/stop", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployStopRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployStopResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployStopResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployUpdate.g.cs deleted file mode 100644 index 1175d1ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeployUpdate.g.cs +++ /dev/null @@ -1,378 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeployUpdateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey, - global::DeepInfra.DeployLLMUpdateIn request); - partial void PrepareDeployUpdateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey, - global::DeepInfra.DeployLLMUpdateIn request); - partial void ProcessDeployUpdateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeployUpdateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - - global::DeepInfra.DeployLLMUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareDeployUpdateArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Put, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeployUpdateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeployUpdateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeployUpdateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployStatusOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - global::DeepInfra.ScaleSettings settings, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DeployLLMUpdateIn - { - Settings = settings, - }; - - return await DeployUpdateAsync( - deployId: deployId, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentLogsQuery.g.cs deleted file mode 100644 index 31a2ae16..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentLogsQuery.g.cs +++ /dev/null @@ -1,348 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeploymentLogsQueryArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? podName, - ref string? from, - ref string? to, - ref int? limit, - ref string? xiApiKey); - partial void PrepareDeploymentLogsQueryRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? podName, - string? from, - string? to, - int? limit, - string? xiApiKey); - partial void ProcessDeploymentLogsQueryResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeploymentLogsQueryResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deployment Logs Query
- /// Query deployment logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// the pod name to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task DeploymentLogsQueryAsync( - string deployId, - string? podName = default, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeploymentLogsQueryArguments( - httpClient: HttpClient, - deployId: ref deployId, - podName: ref podName, - from: ref from, - to: ref to, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/deployment_logs/query", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("deploy_id", deployId) - .AddOptionalParameter("pod_name", podName) - .AddOptionalParameter("from", from) - .AddOptionalParameter("to", to) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeploymentLogsQueryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - podName: podName, - from: from, - to: to, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeploymentLogsQueryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeploymentLogsQueryResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentLogQueryOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentLogQueryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentStats.g.cs deleted file mode 100644 index 7aa5dfae..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeploymentStats.g.cs +++ /dev/null @@ -1,239 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareDeploymentStatsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string from, - ref string? to, - ref string? xiApiKey); - partial void PrepareDeploymentStatsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string from, - string? to, - string? xiApiKey); - partial void ProcessDeploymentStatsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessDeploymentStatsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Deployment Stats - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> DeploymentStatsAsync( - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareDeploymentStatsArguments( - httpClient: HttpClient, - from: ref from, - to: ref to, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/deploy/stats", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareDeploymentStatsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessDeploymentStatsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessDeploymentStatsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ExportApiTokenToVercel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ExportApiTokenToVercel.g.cs deleted file mode 100644 index 3bb45a0f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ExportApiTokenToVercel.g.cs +++ /dev/null @@ -1,310 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareExportApiTokenToVercelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string? xiApiKey, - global::DeepInfra.ApiTokenVercelExportIn request); - partial void PrepareExportApiTokenToVercelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string? xiApiKey, - global::DeepInfra.ApiTokenVercelExportIn request); - partial void ProcessExportApiTokenToVercelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessExportApiTokenToVercelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - - global::DeepInfra.ApiTokenVercelExportIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareExportApiTokenToVercelArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/api-tokens/{apiToken}/vercel_export", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareExportApiTokenToVercelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessExportApiTokenToVercelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessExportApiTokenToVercelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - string projectIdOrName, - bool isSensitive, - bool envDevelopment, - bool envPreview, - bool envProduction, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ApiTokenVercelExportIn - { - ProjectIdOrName = projectIdOrName, - IsSensitive = isSensitive, - EnvDevelopment = envDevelopment, - EnvPreview = envPreview, - EnvProduction = envProduction, - }; - - return await ExportApiTokenToVercelAsync( - apiToken: apiToken, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiToken.g.cs deleted file mode 100644 index cd218c98..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiToken.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string? xiApiKey); - partial void PrepareGetApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string? xiApiKey); - partial void ProcessGetApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiTokenArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/api-tokens/{apiToken}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ApiToken.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ApiToken.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiTokens.g.cs deleted file mode 100644 index 172a5634..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetApiTokens.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetApiTokensArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetApiTokensRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetApiTokensResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetApiTokensResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Api Tokens - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetApiTokensAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetApiTokensArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/api-tokens", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetApiTokensRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetApiTokensResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetApiTokensResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs deleted file mode 100644 index 5f3cb3d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.cs +++ /dev/null @@ -1,223 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetChecklistArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? computeOwed, - object? session); - partial void PrepareGetChecklistRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? computeOwed, - object? session); - partial void ProcessGetChecklistResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetChecklistResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Checklist - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetChecklistAsync( - bool? computeOwed = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetChecklistArguments( - httpClient: HttpClient, - computeOwed: ref computeOwed, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/checklist", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("compute_owed", computeOwed?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetChecklistRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - computeOwed: computeOwed, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetChecklistResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetChecklistResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Checklist.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Checklist.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs deleted file mode 100644 index 32c8afa5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.cs +++ /dev/null @@ -1,212 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetConfigArguments( - global::System.Net.Http.HttpClient httpClient, - object? session); - partial void PrepareGetConfigRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session); - partial void ProcessGetConfigResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetConfigResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Config - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetConfigAsync( - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetConfigArguments( - httpClient: HttpClient, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/config", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetConfigResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetHardware.g.cs deleted file mode 100644 index 50cf701e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetHardware.g.cs +++ /dev/null @@ -1,229 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetHardwareArguments( - global::System.Net.Http.HttpClient httpClient, - ref string model, - ref string? xiApiKey); - partial void PrepareGetHardwareRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string model, - string? xiApiKey); - partial void ProcessGetHardwareResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetHardwareResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Hardware - /// - /// - /// Model name (NVIDIA NemoClaw format) - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetHardwareAsync( - string model, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetHardwareArguments( - httpClient: HttpClient, - model: ref model, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v2/hardware", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("model", model) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetHardwareRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - model: model, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetHardwareResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetHardwareResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.HardwareResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.HardwareResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLiveMetrics.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLiveMetrics.g.cs deleted file mode 100644 index bfe8db6e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLiveMetrics.g.cs +++ /dev/null @@ -1,169 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetLiveMetricsArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareGetLiveMetricsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessGetLiveMetricsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetLiveMetricsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Live Metrics
- /// Get the latest values for the Live metrics section on the web front page. - ///
- /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetLiveMetricsAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetLiveMetricsArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/metrics/live", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetLiveMetricsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetLiveMetricsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetLiveMetricsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.WebLiveMetricsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.WebLiveMetricsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLora.g.cs deleted file mode 100644 index 2281990d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLora.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey); - partial void PrepareGetLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey); - partial void ProcessGetLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Lora - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetLoraArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLoraStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLoraStatus.g.cs deleted file mode 100644 index a633d02b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetLoraStatus.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetLoraStatusArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey); - partial void PrepareGetLoraStatusRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey); - partial void ProcessGetLoraStatusResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetLoraStatusResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Lora Status - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetLoraStatusAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetLoraStatusArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}/status", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetLoraStatusRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetLoraStatusResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetLoraStatusResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetModelLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetModelLoras.g.cs deleted file mode 100644 index 11e781e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetModelLoras.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetModelLorasArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey); - partial void PrepareGetModelLorasRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey); - partial void ProcessGetModelLorasResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetModelLorasResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Model Loras - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetModelLorasAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetModelLorasArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/model/{modelName}/loras", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetModelLorasRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetModelLorasResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetModelLorasResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetRequestCosts.g.cs deleted file mode 100644 index ae9198c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetRequestCosts.g.cs +++ /dev/null @@ -1,255 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetRequestCostsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.RequestCostQuery request); - partial void PrepareGetRequestCostsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.RequestCostQuery request); - partial void ProcessGetRequestCostsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetRequestCostsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetRequestCostsAsync( - - global::DeepInfra.RequestCostQuery request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareGetRequestCostsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/request-costs", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetRequestCostsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetRequestCostsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetRequestCostsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.RequestCostResponse.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.RequestCostResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetRequestCostsAsync( - global::System.Collections.Generic.IList requestIds, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.RequestCostQuery - { - RequestIds = requestIds, - }; - - return await GetRequestCostsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetSshKeys.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetSshKeys.g.cs deleted file mode 100644 index 6753f222..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetSshKeys.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetSshKeysArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetSshKeysRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetSshKeysResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetSshKeysResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Ssh Keys - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> GetSshKeysAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetSshKeysArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/ssh_keys", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetSshKeysRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetSshKeysResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetSshKeysResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetUserLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetUserLoras.g.cs deleted file mode 100644 index 6cefcd70..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetUserLoras.g.cs +++ /dev/null @@ -1,214 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetUserLorasArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetUserLorasRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetUserLorasResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetUserLorasResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get User Loras - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetUserLorasAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetUserLorasArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/user/loras", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetUserLorasRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetUserLorasResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetUserLorasResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoice.g.cs deleted file mode 100644 index 275e7359..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoice.g.cs +++ /dev/null @@ -1,263 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? xiApiKey); - partial void PrepareGetVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? xiApiKey); - partial void ProcessGetVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Voice
- /// Get a voice by its id - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetVoiceArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/voices/{voiceId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoices.g.cs deleted file mode 100644 index 9b1d70fc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetVoices.g.cs +++ /dev/null @@ -1,257 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGetVoicesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareGetVoicesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessGetVoicesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGetVoicesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Get Voices
- /// Get available voices for a given user - ///
- /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GetVoicesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGetVoicesArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/voices", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGetVoicesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGetVoicesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGetVoicesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.GetVoicesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.GetVoicesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubCliLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubCliLogin.g.cs deleted file mode 100644 index dec10d67..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubCliLogin.g.cs +++ /dev/null @@ -1,213 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGithubCliLoginArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loginId); - partial void PrepareGithubCliLoginRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loginId); - partial void ProcessGithubCliLoginResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGithubCliLoginResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Github Cli Login
- /// deepctl is calling this request waiting for auth token during login.
- /// The token is stored in /github/callback - ///
- /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GithubCliLoginAsync( - string loginId, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGithubCliLoginArguments( - httpClient: HttpClient, - loginId: ref loginId); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/github/cli/login", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("login_id", loginId) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGithubCliLoginRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loginId: loginId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGithubCliLoginResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGithubCliLoginResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubLogin.g.cs deleted file mode 100644 index aac25bed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GithubLogin.g.cs +++ /dev/null @@ -1,233 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareGithubLoginArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? loginId, - ref string? origin, - ref string? deal, - ref string? tiToken); - partial void PrepareGithubLoginRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? loginId, - string? origin, - string? deal, - string? tiToken); - partial void ProcessGithubLoginResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessGithubLoginResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Github Login
- /// Initiate github SSO login flow. Callback is /github/callback - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task GithubLoginAsync( - string? loginId = default, - string? origin = default, - string? deal = default, - string? tiToken = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareGithubLoginArguments( - httpClient: HttpClient, - loginId: ref loginId, - origin: ref origin, - deal: ref deal, - tiToken: ref tiToken); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/github/login", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("login_id", loginId) - .AddOptionalParameter("origin", origin) - .AddOptionalParameter("deal", deal) - .AddOptionalParameter("ti_token", tiToken) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareGithubLoginRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loginId: loginId, - origin: origin, - deal: deal, - tiToken: tiToken); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessGithubLoginResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessGithubLoginResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceDeploy.g.cs deleted file mode 100644 index 14e8fb8b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceDeploy.g.cs +++ /dev/null @@ -1,296 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareInferenceDeployArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? xiApiKey); - partial void PrepareInferenceDeployRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? xiApiKey); - partial void ProcessInferenceDeployResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessInferenceDeployResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inference Deploy - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task InferenceDeployAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareInferenceDeployArguments( - httpClient: HttpClient, - deployId: ref deployId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/inference/deploy/{deployId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareInferenceDeployRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessInferenceDeployResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessInferenceDeployResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceModel.g.cs deleted file mode 100644 index 38cb5b72..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InferenceModel.g.cs +++ /dev/null @@ -1,345 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareInferenceModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? version, - ref string? xiApiKey); - partial void PrepareInferenceModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? version, - string? xiApiKey); - partial void ProcessInferenceModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessInferenceModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inference Model - /// - /// - /// - /// model version to run inference against - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task InferenceModelAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareInferenceModelArguments( - httpClient: HttpClient, - modelName: ref modelName, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/inference/{modelName}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareInferenceModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessInferenceModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessInferenceModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InspectScopedJwt.g.cs deleted file mode 100644 index 0d79c3e7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.InspectScopedJwt.g.cs +++ /dev/null @@ -1,227 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareInspectScopedJwtArguments( - global::System.Net.Http.HttpClient httpClient, - ref string jwtoken, - ref string? xiApiKey); - partial void PrepareInspectScopedJwtRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string jwtoken, - string? xiApiKey); - partial void ProcessInspectScopedJwtResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessInspectScopedJwtResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Inspect Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task InspectScopedJwtAsync( - string jwtoken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareInspectScopedJwtArguments( - httpClient: HttpClient, - jwtoken: ref jwtoken, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/scoped-jwt", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("jwtoken", jwtoken) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareInspectScopedJwtRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - jwtoken: jwtoken, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessInspectScopedJwtResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessInspectScopedJwtResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.InspectScopedJWTOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.InspectScopedJWTOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles.g.cs deleted file mode 100644 index c02312f9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles.g.cs +++ /dev/null @@ -1,246 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareListFilesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? after, - ref string? purpose, - ref string? order, - ref int? limit, - ref string? xiApiKey); - partial void PrepareListFilesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? after, - string? purpose, - string? order, - int? limit, - string? xiApiKey); - partial void ProcessListFilesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListFilesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListFilesAsync( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListFilesArguments( - httpClient: HttpClient, - after: ref after, - purpose: ref purpose, - order: ref order, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/files", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("after", after) - .AddOptionalParameter("purpose", purpose) - .AddOptionalParameter("order", order) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListFilesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - purpose: purpose, - order: order, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListFilesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListFilesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles2.g.cs deleted file mode 100644 index bd3fa1ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ListFiles2.g.cs +++ /dev/null @@ -1,246 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareListFiles2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? after, - ref string? purpose, - ref string? order, - ref int? limit, - ref string? xiApiKey); - partial void PrepareListFiles2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? after, - string? purpose, - string? order, - int? limit, - string? xiApiKey); - partial void ProcessListFiles2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessListFiles2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ListFiles2Async( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareListFiles2Arguments( - httpClient: HttpClient, - after: ref after, - purpose: ref purpose, - order: ref order, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/files", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("after", after) - .AddOptionalParameter("purpose", purpose) - .AddOptionalParameter("order", order) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareListFiles2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - purpose: purpose, - order: order, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessListFiles2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessListFiles2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.LogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.LogsQuery.g.cs deleted file mode 100644 index 1d3f540d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.LogsQuery.g.cs +++ /dev/null @@ -1,339 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareLogsQueryArguments( - global::System.Net.Http.HttpClient httpClient, - ref string deployId, - ref string? from, - ref string? to, - ref int? limit, - ref string? xiApiKey); - partial void PrepareLogsQueryRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string deployId, - string? from, - string? to, - int? limit, - string? xiApiKey); - partial void ProcessLogsQueryResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessLogsQueryResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Logs Query
- /// Query inference logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task LogsQueryAsync( - string deployId, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareLogsQueryArguments( - httpClient: HttpClient, - deployId: ref deployId, - from: ref from, - to: ref to, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/logs/query", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("deploy_id", deployId) - .AddOptionalParameter("from", from) - .AddOptionalParameter("to", to) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareLogsQueryRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - deployId: deployId, - from: from, - to: to, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessLogsQueryResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessLogsQueryResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.LogQueryOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.LogQueryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Me.g.cs deleted file mode 100644 index 7691602f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Me.g.cs +++ /dev/null @@ -1,229 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareMeArguments( - global::System.Net.Http.HttpClient httpClient, - ref bool? checklist, - ref string? xiApiKey); - partial void PrepareMeRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - bool? checklist, - string? xiApiKey); - partial void ProcessMeResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessMeResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Me - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task MeAsync( - bool? checklist = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareMeArguments( - httpClient: HttpClient, - checklist: ref checklist, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("checklist", checklist?.ToString().ToLowerInvariant()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareMeRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - checklist: checklist, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessMeResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessMeResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Me.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Me.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelDelete.g.cs deleted file mode 100644 index bd070177..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelDelete.g.cs +++ /dev/null @@ -1,307 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelDeleteArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string version, - ref string? xiApiKey); - partial void PrepareModelDeleteRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string version, - string? xiApiKey); - partial void ProcessModelDeleteResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelDeleteResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Delete - /// - /// - /// - /// delete a particular version, pass 'ALL' to wipe everything - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelDeleteAsync( - string modelName, - string version, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelDeleteArguments( - httpClient: HttpClient, - modelName: ref modelName, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Delete, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelDeleteRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelDeleteResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelDeleteResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamiliesNames.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamiliesNames.g.cs deleted file mode 100644 index 2e184ac6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamiliesNames.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelFamiliesNamesArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelFamiliesNamesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelFamiliesNamesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelFamiliesNamesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Families Names - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelFamiliesNamesAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelFamiliesNamesArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/model-families/names", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelFamiliesNamesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelFamiliesNamesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelFamiliesNamesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamily.g.cs deleted file mode 100644 index b9338d86..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelFamily.g.cs +++ /dev/null @@ -1,250 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelFamilyArguments( - global::System.Net.Http.HttpClient httpClient, - ref string familyName); - partial void PrepareModelFamilyRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string familyName); - partial void ProcessModelFamilyResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelFamilyResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Family - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelFamilyAsync( - string familyName, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelFamilyArguments( - httpClient: HttpClient, - familyName: ref familyName); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/model-families/{familyName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelFamilyRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - familyName: familyName); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelFamilyResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelFamilyResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ModelFamilyOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ModelFamilyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelMetaUpdate.g.cs deleted file mode 100644 index e197edf0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelMetaUpdate.g.cs +++ /dev/null @@ -1,368 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelMetaUpdateArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey, - global::DeepInfra.ModelMetaIn request); - partial void PrepareModelMetaUpdateRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey, - global::DeepInfra.ModelMetaIn request); - partial void ProcessModelMetaUpdateResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelMetaUpdateResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Meta Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - - global::DeepInfra.ModelMetaIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareModelMetaUpdateArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/meta", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelMetaUpdateRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelMetaUpdateResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelMetaUpdateResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Model Meta Update - /// - /// - /// - /// - /// short model description in plain text - /// - /// - /// source code project link (empty to delete) - /// - /// - /// paper/research link (empty to delete) - /// - /// - /// usage license link (empty to delete) - /// - /// - /// markdown flavored model readme - /// - /// - /// dataurl or regular url to cover image (empty to delete) - /// - /// - /// model type - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - string? xiApiKey = default, - string? description = default, - string? githubUrl = default, - string? paperUrl = default, - string? licenseUrl = default, - string? readme = default, - string? coverImgUrl = default, - global::DeepInfra.HFTasksE? reportedType = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ModelMetaIn - { - Description = description, - GithubUrl = githubUrl, - PaperUrl = paperUrl, - LicenseUrl = licenseUrl, - Readme = readme, - CoverImgUrl = coverImgUrl, - ReportedType = reportedType, - }; - - return await ModelMetaUpdateAsync( - modelName: modelName, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelPublicity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelPublicity.g.cs deleted file mode 100644 index 08ff5277..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelPublicity.g.cs +++ /dev/null @@ -1,338 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelPublicityArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey, - global::DeepInfra.ModelPublicityIn request); - partial void PrepareModelPublicityRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey, - global::DeepInfra.ModelPublicityIn request); - partial void ProcessModelPublicityResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelPublicityResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Publicity - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - - global::DeepInfra.ModelPublicityIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareModelPublicityArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/publicity", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelPublicityRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelPublicityResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Unauthorized - if ((int)__response.StatusCode == 401) - { - string? __content_401 = null; - global::System.Exception? __exception_401 = null; - global::DeepInfra.DeepError? __value_401 = null; - try - { - if (ReadResponseAsString) - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - else - { - __content_401 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_401 = global::DeepInfra.DeepError.FromJson(__content_401, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_401 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelPublicityResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Model Publicity - /// - /// - /// - /// - /// whether to make the model public of private - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - bool @public, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ModelPublicityIn - { - Public = @public, - }; - - return await ModelPublicityAsync( - modelName: modelName, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelSchema.g.cs deleted file mode 100644 index 38e2b4bc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelSchema.g.cs +++ /dev/null @@ -1,353 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelSchemaArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref global::DeepInfra.SchemaVariantKey variantKey, - ref string? version, - ref string? xiApiKey); - partial void PrepareModelSchemaRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - global::DeepInfra.SchemaVariantKey variantKey, - string? version, - string? xiApiKey); - partial void ProcessModelSchemaResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelSchemaResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Schema - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelSchemaAsync( - string modelName, - global::DeepInfra.SchemaVariantKey variantKey, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelSchemaArguments( - httpClient: HttpClient, - modelName: ref modelName, - variantKey: ref variantKey, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/schema/{variantKey}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelSchemaRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - variantKey: variantKey, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelSchemaResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Locked - if ((int)__response.StatusCode == 423) - { - string? __content_423 = null; - global::System.Exception? __exception_423 = null; - global::DeepInfra.DeepError? __value_423 = null; - try - { - if (ReadResponseAsString) - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - else - { - __content_423 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_423 = global::DeepInfra.DeepError.FromJson(__content_423, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_423 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_423 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_423, - statusCode: __response.StatusCode) - { - ResponseBody = __content_423, - ResponseObject = __value_423, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelSchemaResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.SchemaOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.SchemaOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelVersions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelVersions.g.cs deleted file mode 100644 index 5067500c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelVersions.g.cs +++ /dev/null @@ -1,262 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelVersionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? xiApiKey); - partial void PrepareModelVersionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? xiApiKey); - partial void ProcessModelVersionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelVersionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Model Versions - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelVersionsAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelVersionsArguments( - httpClient: HttpClient, - modelName: ref modelName, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}/versions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelVersionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelVersionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelVersionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsDeploymentList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsDeploymentList.g.cs deleted file mode 100644 index 6cc8204e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsDeploymentList.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsDeploymentListArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareModelsDeploymentListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessModelsDeploymentListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsDeploymentListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Deployment List - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsDeploymentListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsDeploymentListArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/deployment/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsDeploymentListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsDeploymentListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsDeploymentListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsFeatured.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsFeatured.g.cs deleted file mode 100644 index b708c187..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsFeatured.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsFeaturedArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelsFeaturedRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelsFeaturedResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsFeaturedResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Featured - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsFeaturedAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsFeaturedArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/featured", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsFeaturedRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsFeaturedResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsFeaturedResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsInfo.g.cs deleted file mode 100644 index 82866b1b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsInfo.g.cs +++ /dev/null @@ -1,271 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsInfoArguments( - global::System.Net.Http.HttpClient httpClient, - ref string modelName, - ref string? version, - ref string? xiApiKey); - partial void PrepareModelsInfoRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string modelName, - string? version, - string? xiApiKey); - partial void ProcessModelsInfoResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsInfoResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Info - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task ModelsInfoAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsInfoArguments( - httpClient: HttpClient, - modelName: ref modelName, - version: ref version, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/models/{modelName}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("version", version) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsInfoRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - modelName: modelName, - version: version, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsInfoResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsInfoResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ModelInfoOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ModelInfoOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsList.g.cs deleted file mode 100644 index aa41e38a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsList.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsListArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelsListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelsListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models List - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsListAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsListArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsLoraList.g.cs deleted file mode 100644 index da68f61c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.ModelsLoraList.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareModelsLoraListArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareModelsLoraListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessModelsLoraListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessModelsLoraListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Models Lora List - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> ModelsLoraListAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareModelsLoraListArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/lora/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareModelsLoraListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessModelsLoraListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessModelsLoraListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OktaLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OktaLogin.g.cs deleted file mode 100644 index e09a071a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OktaLogin.g.cs +++ /dev/null @@ -1,225 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOktaLoginArguments( - global::System.Net.Http.HttpClient httpClient, - ref string teamId, - ref string? origin, - ref string? loginId); - partial void PrepareOktaLoginRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string teamId, - string? origin, - string? loginId); - partial void ProcessOktaLoginResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOktaLoginResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Okta Login - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OktaLoginAsync( - string teamId, - string? origin = default, - string? loginId = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOktaLoginArguments( - httpClient: HttpClient, - teamId: ref teamId, - origin: ref origin, - loginId: ref loginId); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/okta/login", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("team_id", teamId) - .AddOptionalParameter("origin", origin) - .AddOptionalParameter("login_id", loginId) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOktaLoginRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - teamId: teamId, - origin: origin, - loginId: loginId); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOktaLoginResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOktaLoginResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech.g.cs deleted file mode 100644 index cb7f5cec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioSpeechArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void PrepareOpenaiAudioSpeechRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void ProcessOpenaiAudioSpeechResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioSpeechResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioSpeechArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/audio/speech", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioSpeechRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioSpeechResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioSpeechResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAITextToSpeechIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - Voice = voice, - ResponseFormat = responseFormat, - Speed = speed, - ExtraBody = extraBody, - }; - - return await OpenaiAudioSpeechAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech2.g.cs deleted file mode 100644 index 57ead2d7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioSpeech2.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioSpeech2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void PrepareOpenaiAudioSpeech2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAITextToSpeechIn request); - partial void ProcessOpenaiAudioSpeech2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioSpeech2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioSpeech2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/audio/speech", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioSpeech2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioSpeech2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioSpeech2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAITextToSpeechIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - Voice = voice, - ResponseFormat = responseFormat, - Speed = speed, - ExtraBody = extraBody, - }; - - return await OpenaiAudioSpeech2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions.g.cs deleted file mode 100644 index 60ae872e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions.g.cs +++ /dev/null @@ -1,346 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranscriptionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); - partial void PrepareOpenaiAudioTranscriptionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request); - partial void ProcessOpenaiAudioTranscriptionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranscriptionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranscriptionsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/audio/transcriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Language != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Language}"), - name: "\"language\""); - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - if (request.TimestampGranularities != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.TimestampGranularities}"), - name: "\"timestamp_granularities\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranscriptionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranscriptionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranscriptionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost - { - File = file, - Filename = filename, - Model = model, - Language = language, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - TimestampGranularities = timestampGranularities, - }; - - return await OpenaiAudioTranscriptionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions2.g.cs deleted file mode 100644 index 5d949b8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranscriptions2.g.cs +++ /dev/null @@ -1,346 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranscriptions2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request); - partial void PrepareOpenaiAudioTranscriptions2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request); - partial void ProcessOpenaiAudioTranscriptions2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranscriptions2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranscriptions2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/audio/transcriptions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Language != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Language}"), - name: "\"language\""); - } - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - if (request.TimestampGranularities != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.TimestampGranularities}"), - name: "\"timestamp_granularities\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranscriptions2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranscriptions2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranscriptions2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost - { - File = file, - Filename = filename, - Model = model, - Language = language, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - TimestampGranularities = timestampGranularities, - }; - - return await OpenaiAudioTranscriptions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations.g.cs deleted file mode 100644 index 1072a73f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations.g.cs +++ /dev/null @@ -1,326 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranslationsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); - partial void PrepareOpenaiAudioTranslationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request); - partial void ProcessOpenaiAudioTranslationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranslationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranslationsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/audio/translations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranslationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranslationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranslationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost - { - File = file, - Filename = filename, - Model = model, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - }; - - return await OpenaiAudioTranslationsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations2.g.cs deleted file mode 100644 index 3e1ab2a9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiAudioTranslations2.g.cs +++ /dev/null @@ -1,326 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiAudioTranslations2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request); - partial void PrepareOpenaiAudioTranslations2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request); - partial void ProcessOpenaiAudioTranslations2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiAudioTranslations2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiAudioTranslations2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/audio/translations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xDeepinfraSource != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xDeepinfraSource}"), - name: "\"x-deepinfra-source\""); - } - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - if (request.Prompt != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - } - if (request.ResponseFormat != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.ResponseFormat}"), - name: "\"response_format\""); - } - if (request.Temperature != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Temperature}"), - name: "\"temperature\""); - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiAudioTranslations2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiAudioTranslations2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiAudioTranslations2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost - { - File = file, - Filename = filename, - Model = model, - Prompt = prompt, - ResponseFormat = responseFormat, - Temperature = temperature, - }; - - return await OpenaiAudioTranslations2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs deleted file mode 100644 index 38997412..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs +++ /dev/null @@ -1,391 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiChatCompletionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void PrepareOpenaiChatCompletionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void ProcessOpenaiChatCompletionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiChatCompletionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiChatCompletionsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/chat/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiChatCompletionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiChatCompletionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiChatCompletionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIChatCompletionsIn - { - Model = model, - Messages = messages, - Stream = stream, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - MaxTokens = maxTokens, - Stop = stop, - N = n, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - Tools = tools, - ToolChoice = toolChoice, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - Logprobs = logprobs, - StreamOptions = streamOptions, - ReasoningEffort = reasoningEffort, - Reasoning = reasoning, - PromptCacheKey = promptCacheKey, - ChatTemplateKwargs = chatTemplateKwargs, - }; - - return await OpenaiChatCompletionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs deleted file mode 100644 index 9ca20d01..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs +++ /dev/null @@ -1,391 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiChatCompletions2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void PrepareOpenaiChatCompletions2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAIChatCompletionsIn request); - partial void ProcessOpenaiChatCompletions2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiChatCompletions2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiChatCompletions2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/chat/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiChatCompletions2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiChatCompletions2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiChatCompletions2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIChatCompletionsIn - { - Model = model, - Messages = messages, - Stream = stream, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - MaxTokens = maxTokens, - Stop = stop, - N = n, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - Tools = tools, - ToolChoice = toolChoice, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - Logprobs = logprobs, - StreamOptions = streamOptions, - ReasoningEffort = reasoningEffort, - Reasoning = reasoning, - PromptCacheKey = promptCacheKey, - ChatTemplateKwargs = chatTemplateKwargs, - }; - - return await OpenaiChatCompletions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions.g.cs deleted file mode 100644 index 4f4a4d17..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions.g.cs +++ /dev/null @@ -1,386 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiCompletionsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void PrepareOpenaiCompletionsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void ProcessOpenaiCompletionsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiCompletionsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiCompletionsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiCompletionsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiCompletionsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiCompletionsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAICompletionsIn - { - Model = model, - Prompt = prompt, - MaxTokens = maxTokens, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - N = n, - Stream = stream, - Logprobs = logprobs, - Echo = echo, - Stop = stop, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - StreamOptions = streamOptions, - StopTokenIds = stopTokenIds, - ReturnTokensAsTokenIds = returnTokensAsTokenIds, - PromptCacheKey = promptCacheKey, - Data = data, - }; - - return await OpenaiCompletionsAsync( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions2.g.cs deleted file mode 100644 index 6144d6dc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiCompletions2.g.cs +++ /dev/null @@ -1,386 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiCompletions2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void PrepareOpenaiCompletions2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? xiApiKey, - global::DeepInfra.OpenAICompletionsIn request); - partial void ProcessOpenaiCompletions2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiCompletions2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletions2Async( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiCompletions2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/completions", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiCompletions2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiCompletions2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiCompletions2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiCompletions2Async( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAICompletionsIn - { - Model = model, - Prompt = prompt, - MaxTokens = maxTokens, - Temperature = temperature, - TopP = topP, - MinP = minP, - TopK = topK, - N = n, - Stream = stream, - Logprobs = logprobs, - Echo = echo, - Stop = stop, - PresencePenalty = presencePenalty, - FrequencyPenalty = frequencyPenalty, - ResponseFormat = responseFormat, - RepetitionPenalty = repetitionPenalty, - User = user, - Seed = seed, - StreamOptions = streamOptions, - StopTokenIds = stopTokenIds, - ReturnTokensAsTokenIds = returnTokensAsTokenIds, - PromptCacheKey = promptCacheKey, - Data = data, - }; - - return await OpenaiCompletions2Async( - xDeepinfraSource: xDeepinfraSource, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.cs deleted file mode 100644 index e5e65758..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiEmbeddingsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? userAgent, - ref string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void PrepareOpenaiEmbeddingsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? userAgent, - string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void ProcessOpenaiEmbeddingsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiEmbeddingsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiEmbeddingsArguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - userAgent: ref userAgent, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/embeddings", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (userAgent != default) - { - __httpRequest.Headers.TryAddWithoutValidation("user-agent", userAgent.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiEmbeddingsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiEmbeddingsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiEmbeddingsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIEmbeddingsIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - EncodingFormat = encodingFormat, - Dimensions = dimensions, - }; - - return await OpenaiEmbeddingsAsync( - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings2.g.cs deleted file mode 100644 index c0736e7f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings2.g.cs +++ /dev/null @@ -1,300 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiEmbeddings2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xDeepinfraSource, - ref string? userAgent, - ref string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void PrepareOpenaiEmbeddings2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xDeepinfraSource, - string? userAgent, - string? xiApiKey, - global::DeepInfra.OpenAIEmbeddingsIn request); - partial void ProcessOpenaiEmbeddings2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiEmbeddings2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiEmbeddings2Arguments( - httpClient: HttpClient, - xDeepinfraSource: ref xDeepinfraSource, - userAgent: ref userAgent, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/embeddings", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xDeepinfraSource != default) - { - __httpRequest.Headers.TryAddWithoutValidation("x-deepinfra-source", xDeepinfraSource.ToString()); - } - if (userAgent != default) - { - __httpRequest.Headers.TryAddWithoutValidation("user-agent", userAgent.ToString()); - } - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiEmbeddings2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiEmbeddings2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiEmbeddings2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIEmbeddingsIn - { - ServiceTier = serviceTier, - Model = model, - Input = input, - EncodingFormat = encodingFormat, - Dimensions = dimensions, - }; - - return await OpenaiEmbeddings2Async( - xDeepinfraSource: xDeepinfraSource, - userAgent: userAgent, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles.g.cs deleted file mode 100644 index 63ba6d88..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiFilesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1FilesPost request); - partial void PrepareOpenaiFilesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1FilesPost request); - partial void ProcessOpenaiFilesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiFilesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFilesAsync( - - global::DeepInfra.BodyOpenaiFilesV1FilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiFilesArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/files", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Purpose}"), - name: "\"purpose\""); - for (var __iFile = 0; __iFile < request.File.Count; __iFile++) - { - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File[__iFile]); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: $"\"file{__iFile}.bin\""); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiFilesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiFilesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiFilesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFilesAsync( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiFilesV1FilesPost - { - Purpose = purpose, - File = file, - }; - - return await OpenaiFilesAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles2.g.cs deleted file mode 100644 index 88dc83a9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiFiles2.g.cs +++ /dev/null @@ -1,272 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiFiles2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request); - partial void PrepareOpenaiFiles2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request); - partial void ProcessOpenaiFiles2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiFiles2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFiles2Async( - - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiFiles2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/files", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Purpose}"), - name: "\"purpose\""); - for (var __iFile = 0; __iFile < request.File.Count; __iFile++) - { - var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File[__iFile]); - __httpRequestContent.Add( - content: __contentFile, - name: "\"file\"", - fileName: $"\"file{__iFile}.bin\""); - if (__contentFile.Headers.ContentDisposition != null) - { - __contentFile.Headers.ContentDisposition.FileNameStar = null; - } - } - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiFiles2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiFiles2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiFiles2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiFiles2Async( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost - { - Purpose = purpose, - File = file, - }; - - return await OpenaiFiles2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits.g.cs deleted file mode 100644 index debf7995..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits.g.cs +++ /dev/null @@ -1,294 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesEditsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); - partial void PrepareOpenaiImagesEditsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request); - partial void ProcessOpenaiImagesEditsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesEditsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesEditsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesEditsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesEditsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesEditsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Prompt = prompt, - Model = model, - }; - - return await OpenaiImagesEditsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits2.g.cs deleted file mode 100644 index 67197f4c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesEdits2.g.cs +++ /dev/null @@ -1,294 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesEdits2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request); - partial void PrepareOpenaiImagesEdits2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request); - partial void ProcessOpenaiImagesEdits2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesEdits2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesEdits2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/images/edits", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Prompt}"), - name: "\"prompt\""); - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesEdits2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesEdits2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesEdits2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Prompt = prompt, - Model = model, - }; - - return await OpenaiImagesEdits2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations.g.cs deleted file mode 100644 index b343b091..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations.g.cs +++ /dev/null @@ -1,297 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesGenerationsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void PrepareOpenaiImagesGenerationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void ProcessOpenaiImagesGenerationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesGenerationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesGenerationsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/images/generations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesGenerationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesGenerationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesGenerationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIImagesGenerationsIn - { - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - Prompt = prompt, - Quality = quality, - Style = style, - }; - - return await OpenaiImagesGenerationsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations2.g.cs deleted file mode 100644 index ae1af47b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesGenerations2.g.cs +++ /dev/null @@ -1,297 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesGenerations2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void PrepareOpenaiImagesGenerations2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.OpenAIImagesGenerationsIn request); - partial void ProcessOpenaiImagesGenerations2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesGenerations2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesGenerations2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/images/generations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesGenerations2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesGenerations2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesGenerations2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.OpenAIImagesGenerationsIn - { - Model = model, - N = n, - ResponseFormat = responseFormat, - Size = size, - User = user, - Prompt = prompt, - Quality = quality, - Style = style, - }; - - return await OpenaiImagesGenerations2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations.g.cs deleted file mode 100644 index caa5f7c4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations.g.cs +++ /dev/null @@ -1,288 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesVariationsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); - partial void PrepareOpenaiImagesVariationsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request); - partial void ProcessOpenaiImagesVariationsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesVariationsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesVariationsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesVariationsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesVariationsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesVariationsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Model = model, - }; - - return await OpenaiImagesVariationsAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations2.g.cs deleted file mode 100644 index 659254ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiImagesVariations2.g.cs +++ /dev/null @@ -1,288 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiImagesVariations2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request); - partial void PrepareOpenaiImagesVariations2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request); - partial void ProcessOpenaiImagesVariations2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiImagesVariations2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareOpenaiImagesVariations2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/images/variations", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - using var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); - if (xiApiKey != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{xiApiKey}"), - name: "\"xi-api-key\""); - } - var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); - __httpRequestContent.Add( - content: __contentImage, - name: "\"image\"", - fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); - if (__contentImage.Headers.ContentDisposition != null) - { - __contentImage.Headers.ContentDisposition.FileNameStar = null; - } - if (request.Inp != default) - { - - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Inp}"), - name: "\"inp\""); - } - __httpRequestContent.Add( - content: new global::System.Net.Http.StringContent($"{request.Model}"), - name: "\"model\""); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiImagesVariations2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiImagesVariations2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiImagesVariations2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIImagesOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIImagesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost - { - Image = image, - Imagename = imagename, - Inp = inp, - Model = model, - }; - - return await OpenaiImagesVariations2Async( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels.g.cs deleted file mode 100644 index f37b2e97..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiModelsArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareOpenaiModelsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessOpenaiModelsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiModelsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiModelsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOpenaiModelsArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiModelsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiModelsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiModelsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIModelsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels2.g.cs deleted file mode 100644 index fad67dca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiModels2.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenaiModels2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PrepareOpenaiModels2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessOpenaiModels2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenaiModels2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenaiModels2Async( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOpenaiModels2Arguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenaiModels2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenaiModels2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenaiModels2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenAIModelsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenAIModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenrouterModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenrouterModels.g.cs deleted file mode 100644 index 770c2488..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenrouterModels.g.cs +++ /dev/null @@ -1,168 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareOpenrouterModelsArguments( - global::System.Net.Http.HttpClient httpClient); - partial void PrepareOpenrouterModelsRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage); - partial void ProcessOpenrouterModelsResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessOpenrouterModelsResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Openrouter Models - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task OpenrouterModelsAsync( - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareOpenrouterModelsArguments( - httpClient: HttpClient); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/openrouter/models", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareOpenrouterModelsRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessOpenrouterModelsResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessOpenrouterModelsResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.OpenRouterModelsOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.OpenRouterModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.PrivateModelsList.g.cs deleted file mode 100644 index 24c09cb9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.PrivateModelsList.g.cs +++ /dev/null @@ -1,218 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PreparePrivateModelsListArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey); - partial void PreparePrivateModelsListRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey); - partial void ProcessPrivateModelsListResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessPrivateModelsListResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Private Models List - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task> PrivateModelsListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PreparePrivateModelsListArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/models/private/list", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PreparePrivateModelsListRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessPrivateModelsListResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessPrivateModelsListResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RentGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RentGpuAvailability.g.cs deleted file mode 100644 index 8ca72882..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RentGpuAvailability.g.cs +++ /dev/null @@ -1,234 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRentGpuAvailabilityArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? source, - ref string? baseModel, - ref string? xiApiKey); - partial void PrepareRentGpuAvailabilityRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? source, - string? baseModel, - string? xiApiKey); - partial void ProcessRentGpuAvailabilityResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRentGpuAvailabilityResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Rent Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RentGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRentGpuAvailabilityArguments( - httpClient: HttpClient, - source: ref source, - baseModel: ref baseModel, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/containers/gpu_availability", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("source", source) - .AddOptionalParameter("base_model", baseModel) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRentGpuAvailabilityRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - source: source, - baseModel: baseModel, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRentGpuAvailabilityResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRentGpuAvailabilityResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeployGPUAvailability.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeployGPUAvailability.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestGpuLimitIncrease.g.cs deleted file mode 100644 index 589a2d9c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestGpuLimitIncrease.g.cs +++ /dev/null @@ -1,333 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRequestGpuLimitIncreaseArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.GpuLimitRequestIn request); - partial void PrepareRequestGpuLimitIncreaseRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.GpuLimitRequestIn request); - partial void ProcessRequestGpuLimitIncreaseResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRequestGpuLimitIncreaseResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - - global::DeepInfra.GpuLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRequestGpuLimitIncreaseArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/gpu_limit/request", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRequestGpuLimitIncreaseRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRequestGpuLimitIncreaseResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRequestGpuLimitIncreaseResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - string gpuType, - int requestedLimit, - string reason, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.GpuLimitRequestIn - { - GpuType = gpuType, - RequestedLimit = requestedLimit, - Reason = reason, - }; - - return await RequestGpuLimitIncreaseAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestRateLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestRateLimitIncrease.g.cs deleted file mode 100644 index d92ca2b3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RequestRateLimitIncrease.g.cs +++ /dev/null @@ -1,333 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRequestRateLimitIncreaseArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.RateLimitRequestIn request); - partial void PrepareRequestRateLimitIncreaseRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.RateLimitRequestIn request); - partial void ProcessRequestRateLimitIncreaseResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRequestRateLimitIncreaseResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Request Rate Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - - global::DeepInfra.RateLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareRequestRateLimitIncreaseArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/rate_limit/request", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRequestRateLimitIncreaseRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRequestRateLimitIncreaseResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRequestRateLimitIncreaseResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Request Rate Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - int rateLimit, - string reason, - string? xiApiKey = default, - int? tpmRateLimit = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.RateLimitRequestIn - { - RateLimit = rateLimit, - TpmRateLimit = tpmRateLimit, - Reason = reason, - }; - - return await RequestRateLimitIncreaseAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch.g.cs deleted file mode 100644 index 6d65618d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatchArguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatchRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatchResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatchResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatchAsync( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatchArguments( - httpClient: HttpClient, - batchId: ref batchId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/batches/{batchId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatchRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatchResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatchResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch2.g.cs deleted file mode 100644 index a3ee7bdb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatch2.g.cs +++ /dev/null @@ -1,220 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatch2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string batchId, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatch2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string batchId, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatch2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatch2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatch2Async( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatch2Arguments( - httpClient: HttpClient, - batchId: ref batchId, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/openai/batches/{batchId}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatch2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - batchId: batchId, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatch2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatch2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches.g.cs deleted file mode 100644 index 2629fb0d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatchesArguments( - global::System.Net.Http.HttpClient httpClient, - ref string after, - ref int? limit, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatchesRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string after, - int? limit, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatchesResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatchesResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatchesAsync( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatchesArguments( - httpClient: HttpClient, - after: ref after, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/batches", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("after", after) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatchesRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatchesResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatchesResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches2.g.cs deleted file mode 100644 index c65f4c12..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.RetrieveOpenaiBatches2.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareRetrieveOpenaiBatches2Arguments( - global::System.Net.Http.HttpClient httpClient, - ref string after, - ref int? limit, - ref string? xiApiKey); - partial void PrepareRetrieveOpenaiBatches2Request( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string after, - int? limit, - string? xiApiKey); - partial void ProcessRetrieveOpenaiBatches2Response( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessRetrieveOpenaiBatches2ResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task RetrieveOpenaiBatches2Async( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareRetrieveOpenaiBatches2Arguments( - httpClient: HttpClient, - after: ref after, - limit: ref limit, - xiApiKey: ref xiApiKey); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/openai/batches", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("after", after) - .AddOptionalParameter("limit", limit?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareRetrieveOpenaiBatches2Request( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - after: after, - limit: limit, - xiApiKey: xiApiKey); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessRetrieveOpenaiBatches2Response( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessRetrieveOpenaiBatches2ResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs deleted file mode 100644 index 23554d53..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.cs +++ /dev/null @@ -1,251 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareSetConfigArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.ConfigIn request); - partial void PrepareSetConfigRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.ConfigIn request); - partial void ProcessSetConfigResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSetConfigResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Set Config - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetConfigAsync( - - global::DeepInfra.ConfigIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareSetConfigArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/config", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSetConfigRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSetConfigResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSetConfigResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.ConfigOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.ConfigOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Set Config - /// - /// - /// - /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetConfigAsync( - object? session = default, - double? limit = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ConfigIn - { - Limit = limit, - }; - - return await SetConfigAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs deleted file mode 100644 index 893a8fca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.cs +++ /dev/null @@ -1,260 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareSetupTopupArguments( - global::System.Net.Http.HttpClient httpClient, - object? session, - global::DeepInfra.TopUpIn request); - partial void PrepareSetupTopupRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - object? session, - global::DeepInfra.TopUpIn request); - partial void ProcessSetupTopupResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSetupTopupResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Setup Topup - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetupTopupAsync( - - global::DeepInfra.TopUpIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareSetupTopupArguments( - httpClient: HttpClient, - session: session, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/topup", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSetupTopupRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - session: session, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSetupTopupResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSetupTopupResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Setup Topup - /// - /// - /// - /// Amount to top up in cents
- /// Default Value: 0 - /// - /// - /// Top up threshold in cents, if balance goes below this value, top up will be triggered
- /// Default Value: 0 - /// - /// - /// If true, top up will be triggered when balance goes below threshold
- /// Default Value: true - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SetupTopupAsync( - object? session = default, - int? amount = default, - int? threshold = default, - bool? enabled = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.TopUpIn - { - Amount = amount, - Threshold = threshold, - Enabled = enabled, - }; - - return await SetupTopupAsync( - session: session, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SubmitFeedback.g.cs deleted file mode 100644 index fb350348..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SubmitFeedback.g.cs +++ /dev/null @@ -1,298 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareSubmitFeedbackArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.FeedbackIn request); - partial void PrepareSubmitFeedbackRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.FeedbackIn request); - partial void ProcessSubmitFeedbackResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessSubmitFeedbackResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SubmitFeedbackAsync( - - global::DeepInfra.FeedbackIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareSubmitFeedbackArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/feedback", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareSubmitFeedbackRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessSubmitFeedbackResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Forbidden - if ((int)__response.StatusCode == 403) - { - string? __content_403 = null; - global::System.Exception? __exception_403 = null; - global::DeepInfra.DeepError? __value_403 = null; - try - { - if (ReadResponseAsString) - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - else - { - __content_403 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_403 = global::DeepInfra.DeepError.FromJson(__content_403, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_403 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessSubmitFeedbackResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The message you'd like to send to deepinfra team - /// - /// - /// Optional contact email to reach you back - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task SubmitFeedbackAsync( - string message, - string? xiApiKey = default, - string? contactEmail = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.FeedbackIn - { - Message = message, - ContactEmail = contactEmail, - }; - - return await SubmitFeedbackAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TeamSetDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TeamSetDisplayName.g.cs deleted file mode 100644 index 7279bb03..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TeamSetDisplayName.g.cs +++ /dev/null @@ -1,329 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareTeamSetDisplayNameArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.DisplayNameIn request); - partial void PrepareTeamSetDisplayNameRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.DisplayNameIn request); - partial void ProcessTeamSetDisplayNameResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTeamSetDisplayNameResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Team Set Display Name - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - - global::DeepInfra.DisplayNameIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTeamSetDisplayNameArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/v1/me/team_display_name", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTeamSetDisplayNameRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTeamSetDisplayNameResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Conflict - if ((int)__response.StatusCode == 409) - { - string? __content_409 = null; - global::System.Exception? __exception_409 = null; - global::DeepInfra.DeepError? __value_409 = null; - try - { - if (ReadResponseAsString) - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - else - { - __content_409 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_409 = global::DeepInfra.DeepError.FromJson(__content_409, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_409 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTeamSetDisplayNameResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Team Set Display Name - /// - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - string displayName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.DisplayNameIn - { - DisplayName = displayName, - }; - - return await TeamSetDisplayNameAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeech.g.cs deleted file mode 100644 index 11ef44b6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeech.g.cs +++ /dev/null @@ -1,291 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareTextToSpeechArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? outputFormat, - ref string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void PrepareTextToSpeechRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? outputFormat, - string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void ProcessTextToSpeechResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTextToSpeechResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTextToSpeechArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - outputFormat: ref outputFormat, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/text-to-speech/{voiceId}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("output_format", outputFormat) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTextToSpeechRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTextToSpeechResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTextToSpeechResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ElevenLabsTextToSpeechIn - { - Text = text, - ModelId = modelId, - OutputFormat = requestOutputFormat, - LanguageCode = languageCode, - }; - - return await TextToSpeechAsync( - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeechStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeechStream.g.cs deleted file mode 100644 index 47354a47..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.TextToSpeechStream.g.cs +++ /dev/null @@ -1,291 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareTextToSpeechStreamArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? outputFormat, - ref string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void PrepareTextToSpeechStreamRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? outputFormat, - string? xiApiKey, - global::DeepInfra.ElevenLabsTextToSpeechIn request); - partial void ProcessTextToSpeechStreamResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessTextToSpeechStreamResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareTextToSpeechStreamArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - outputFormat: ref outputFormat, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/text-to-speech/{voiceId}/stream", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddOptionalParameter("output_format", outputFormat) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareTextToSpeechStreamRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessTextToSpeechStreamResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessTextToSpeechStreamResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.ElevenLabsTextToSpeechIn - { - Text = text, - ModelId = modelId, - OutputFormat = requestOutputFormat, - LanguageCode = languageCode, - }; - - return await TextToSpeechStreamAsync( - voiceId: voiceId, - outputFormat: outputFormat, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateLora.g.cs deleted file mode 100644 index 457328bf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateLora.g.cs +++ /dev/null @@ -1,263 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUpdateLoraArguments( - global::System.Net.Http.HttpClient httpClient, - ref string loraName, - ref string? xiApiKey, - global::DeepInfra.UpdateLoraApiRequest request); - partial void PrepareUpdateLoraRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string loraName, - string? xiApiKey, - global::DeepInfra.UpdateLoraApiRequest request); - partial void ProcessUpdateLoraResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUpdateLoraResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update Lora - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - - global::DeepInfra.UpdateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUpdateLoraArguments( - httpClient: HttpClient, - loraName: ref loraName, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/lora/{loraName}", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: new global::System.Net.Http.HttpMethod("PATCH"), - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateLoraRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - loraName: loraName, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateLoraResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateLoraResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return __content; - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return __content; - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Update Lora - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - string? xiApiKey = default, - bool? @private = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.UpdateLoraApiRequest - { - Private = @private, - Description = description, - }; - - return await UpdateLoraAsync( - loraName: loraName, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateVoice.g.cs deleted file mode 100644 index 9d9384a4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UpdateVoice.g.cs +++ /dev/null @@ -1,343 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUpdateVoiceArguments( - global::System.Net.Http.HttpClient httpClient, - ref string voiceId, - ref string? xiApiKey, - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); - partial void PrepareUpdateVoiceRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string voiceId, - string? xiApiKey, - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request); - partial void ProcessUpdateVoiceResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUpdateVoiceResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Update Voice - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUpdateVoiceArguments( - httpClient: HttpClient, - voiceId: ref voiceId, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/v1/voices/{voiceId}/edit", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/x-www-form-urlencoded"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUpdateVoiceRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - voiceId: voiceId, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUpdateVoiceResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Not Found - if ((int)__response.StatusCode == 404) - { - string? __content_404 = null; - global::System.Exception? __exception_404 = null; - global::DeepInfra.DeepError? __value_404 = null; - try - { - if (ReadResponseAsString) - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - else - { - __content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_404 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUpdateVoiceResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.Voice.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.Voice.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Update Voice - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - string name, - string description, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost - { - Name = name, - Description = description, - }; - - return await UpdateVoiceAsync( - voiceId: voiceId, - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UploadLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UploadLoraModel.g.cs deleted file mode 100644 index ce8cded0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UploadLoraModel.g.cs +++ /dev/null @@ -1,302 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUploadLoraModelArguments( - global::System.Net.Http.HttpClient httpClient, - ref string? xiApiKey, - global::DeepInfra.LoraModelUploadIn request); - partial void PrepareUploadLoraModelRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string? xiApiKey, - global::DeepInfra.LoraModelUploadIn request); - partial void ProcessUploadLoraModelResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUploadLoraModelResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Upload Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadLoraModelAsync( - - global::DeepInfra.LoraModelUploadIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - request = request ?? throw new global::System.ArgumentNullException(nameof(request)); - - PrepareArguments( - client: HttpClient); - PrepareUploadLoraModelArguments( - httpClient: HttpClient, - xiApiKey: ref xiApiKey, - request: request); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/lora-model", - baseUri: HttpClient.BaseAddress); - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Post, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - if (xiApiKey != default) - { - __httpRequest.Headers.TryAddWithoutValidation("xi-api-key", xiApiKey.ToString()); - } - - var __httpRequestContentBody = request.ToJson(JsonSerializerContext); - var __httpRequestContent = new global::System.Net.Http.StringContent( - content: __httpRequestContentBody, - encoding: global::System.Text.Encoding.UTF8, - mediaType: "application/json"); - __httpRequest.Content = __httpRequestContent; - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUploadLoraModelRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - xiApiKey: xiApiKey, - request: request); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUploadLoraModelResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Bad Request - if ((int)__response.StatusCode == 400) - { - string? __content_400 = null; - global::System.Exception? __exception_400 = null; - global::DeepInfra.DeepError? __value_400 = null; - try - { - if (ReadResponseAsString) - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - else - { - __content_400 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_400 = global::DeepInfra.DeepError.FromJson(__content_400, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_400 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUploadLoraModelResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.DeploymentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.DeploymentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - /// - /// Upload Lora Model - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UploadLoraModelAsync( - string hfModelName, - string loraModelName, - string? xiApiKey = default, - string? hfToken = default, - string? baseModelName = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - var __request = new global::DeepInfra.LoraModelUploadIn - { - HfModelName = hfModelName, - HfToken = hfToken, - LoraModelName = loraModelName, - BaseModelName = baseModelName, - }; - - return await UploadLoraModelAsync( - xiApiKey: xiApiKey, - request: __request, - cancellationToken: cancellationToken).ConfigureAwait(false); - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs deleted file mode 100644 index 82161e61..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageArguments( - global::System.Net.Http.HttpClient httpClient, - ref string from, - ref string? to, - object? session); - partial void PrepareUsageRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string from, - string? to, - object? session); - partial void ProcessUsageResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageArguments( - httpClient: HttpClient, - from: ref from, - to: ref to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/usage", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs deleted file mode 100644 index 30bc3678..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.cs +++ /dev/null @@ -1,238 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageApiTokenArguments( - global::System.Net.Http.HttpClient httpClient, - ref string apiToken, - ref string from, - ref string? to, - object? session); - partial void PrepareUsageApiTokenRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string apiToken, - string from, - string? to, - object? session); - partial void ProcessUsageApiTokenResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageApiTokenResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage Api Token - /// - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageApiTokenAsync( - string apiToken, - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageApiTokenArguments( - httpClient: HttpClient, - apiToken: ref apiToken, - from: ref from, - to: ref to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: $"/payment/usage/{apiToken}", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageApiTokenRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - apiToken: apiToken, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageApiTokenResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageApiTokenResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs deleted file mode 100644 index c9fee5d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageRentArguments( - global::System.Net.Http.HttpClient httpClient, - ref int from, - int? to, - object? session); - partial void PrepareUsageRentRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - int from, - int? to, - object? session); - partial void ProcessUsageRentResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageRentResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage Rent - /// - /// - /// start of period, in seconds since unix epoch - /// - /// - /// end of period, in seconds since unix epoch - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageRentAsync( - int from, - int? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageRentArguments( - httpClient: HttpClient, - from: ref from, - to: to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/usage/rent", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from.ToString()!) - .AddOptionalParameter("to", to?.ToString()) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageRentRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageRentResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageRentResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageRentOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageRentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs deleted file mode 100644 index e21b88e4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.cs +++ /dev/null @@ -1,232 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - public partial class DeepInfraClient - { - partial void PrepareUsageTokensArguments( - global::System.Net.Http.HttpClient httpClient, - ref string from, - ref string? to, - object? session); - partial void PrepareUsageTokensRequest( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpRequestMessage httpRequestMessage, - string from, - string? to, - object? session); - partial void ProcessUsageTokensResponse( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage); - - partial void ProcessUsageTokensResponseContent( - global::System.Net.Http.HttpClient httpClient, - global::System.Net.Http.HttpResponseMessage httpResponseMessage, - ref string content); - - /// - /// Usage Tokens - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - public async global::System.Threading.Tasks.Task UsageTokensAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default) - { - PrepareArguments( - client: HttpClient); - PrepareUsageTokensArguments( - httpClient: HttpClient, - from: ref from, - to: ref to, - session: session); - - var __pathBuilder = new global::DeepInfra.PathBuilder( - path: "/payment/usage/tokens", - baseUri: HttpClient.BaseAddress); - __pathBuilder - .AddRequiredParameter("from", from) - .AddOptionalParameter("to", to) - ; - var __path = __pathBuilder.ToString(); - using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( - method: global::System.Net.Http.HttpMethod.Get, - requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); -#if NET6_0_OR_GREATER - __httpRequest.Version = global::System.Net.HttpVersion.Version11; - __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; -#endif - - foreach (var __authorization in Authorizations) - { - if (__authorization.Type == "Http" || - __authorization.Type == "OAuth2") - { - __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( - scheme: __authorization.Name, - parameter: __authorization.Value); - } - else if (__authorization.Type == "ApiKey" && - __authorization.Location == "Header") - { - __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); - } - } - - PrepareRequest( - client: HttpClient, - request: __httpRequest); - PrepareUsageTokensRequest( - httpClient: HttpClient, - httpRequestMessage: __httpRequest, - from: from, - to: to, - session: session); - - using var __response = await HttpClient.SendAsync( - request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, - cancellationToken: cancellationToken).ConfigureAwait(false); - - ProcessResponse( - client: HttpClient, - response: __response); - ProcessUsageTokensResponse( - httpClient: HttpClient, - httpResponseMessage: __response); - // Validation Error - if ((int)__response.StatusCode == 422) - { - string? __content_422 = null; - global::System.Exception? __exception_422 = null; - global::DeepInfra.HTTPValidationError? __value_422 = null; - try - { - if (ReadResponseAsString) - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - else - { - __content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); - - __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); - } - } - catch (global::System.Exception __ex) - { - __exception_422 = __ex; - } - - throw new global::DeepInfra.ApiException( - message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, - innerException: __exception_422, - statusCode: __response.StatusCode) - { - ResponseBody = __content_422, - ResponseObject = __value_422, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - - if (ReadResponseAsString) - { - var __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - ProcessResponseContent( - client: HttpClient, - response: __response, - content: ref __content); - ProcessUsageTokensResponseContent( - httpClient: HttpClient, - httpResponseMessage: __response, - content: ref __content); - - try - { - __response.EnsureSuccessStatusCode(); - - return - global::DeepInfra.UsageOut.FromJson(__content, JsonSerializerContext) ?? - throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); - } - catch (global::System.Exception __ex) - { - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - else - { - try - { - __response.EnsureSuccessStatusCode(); - - using var __content = await __response.Content.ReadAsStreamAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - - return - await global::DeepInfra.UsageOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? - throw new global::System.InvalidOperationException("Response deserialization failed."); - } - catch (global::System.Exception __ex) - { - string? __content = null; - try - { - __content = await __response.Content.ReadAsStringAsync( -#if NET5_0_OR_GREATER - cancellationToken -#endif - ).ConfigureAwait(false); - } - catch (global::System.Exception) - { - } - - throw new global::DeepInfra.ApiException( - message: __content ?? __response.ReasonPhrase ?? string.Empty, - innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( - __response.Headers, - h => h.Key, - h => h.Value), - }; - } - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs index eff64c8b..5480a310 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.g.cs @@ -4,6 +4,7 @@ namespace DeepInfra { /// + /// The DeepInfra API provides serverless AI inference, custom model deployments, and GPU rentals.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
@@ -30,12 +31,195 @@ public sealed partial class DeepInfraClient : global::DeepInfra.IDeepInfraClient #if DEBUG = true; #endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } /// /// /// public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + /// + /// User profile, team management, and rate limits. + /// + public AccountClient Account => new AccountClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Manage agent-framework instances (OpenClaw and friends). + /// + public AgentsClient Agents => new AgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// OpenAI-compatible speech synthesis, transcription, and translation. + /// + public AudioClient Audio => new AudioClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// API tokens, SSH keys, scoped JWTs, and login flows. + /// + public AuthenticationClient Authentication => new AuthenticationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Payment methods, usage tracking, and billing. + /// + public BillingClient Billing => new BillingClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs. + /// + public ChatCompletionsClient ChatCompletions => new ChatCompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Deploy and manage private model instances with autoscaling. + /// + public DedicatedModelsClient DedicatedModels => new DedicatedModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Generate text embeddings for search and RAG. + /// + public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// File uploads and batch processing. + /// + public FilesBatchesClient FilesBatches => new FilesBatchesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Rent dedicated GPU containers. + /// + public GpuRentalsClient GpuRentals => new GpuRentalsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Generate, edit, and create variations of images. + /// + public ImageGenerationClient ImageGeneration => new ImageGenerationClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Native DeepInfra inference API for models and deployments. + /// + public InferenceClient Inference => new InferenceClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Create, manage, and query LoRA adapter models. + /// + public LoRAAdaptersClient LoRAAdapters => new LoRAAdaptersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Query inference logs, deployment logs, and usage metrics. + /// + public LogsMetricsClient LogsMetrics => new LogsMetricsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Browse, search, and manage AI models. + /// + public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// OpenAI-compatible text completion endpoints. + /// + public TextCompletionsClient TextCompletions => new TextCompletionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// ElevenLabs-compatible TTS endpoints and voice management. + /// + public TextToSpeechClient TextToSpeech => new TextToSpeechClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// + /// + public TokenizerClient Tokenizer => new TokenizerClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// Feedback submission and CLI version. + /// + public UtilitiesClient Utilities => new UtilitiesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + + /// + /// + /// + public VideosClient Videos => new VideosClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + /// /// Creates a new instance of the DeepInfraClient. /// If no httpClient is provided, a new one will be created. @@ -49,11 +233,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..6c17a4f6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.OpenaiEmbeddings.g.cs @@ -0,0 +1,584 @@ + +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// 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, + 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, + 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..37023c4a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.EmbeddingsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate text embeddings for search and RAG.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class EmbeddingsClient : global::DeepInfra.IEmbeddingsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the EmbeddingsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public EmbeddingsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the EmbeddingsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public EmbeddingsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the EmbeddingsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public EmbeddingsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs index 7be0e5f7..b5c210c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Exceptions.g.cs @@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception /// The HTTP status code of the response. ///
public global::System.Net.HttpStatusCode StatusCode { get; } + /// /// The response body as a string, or null if the body could not be read. /// This is always populated for error responses regardless of the ReadResponseAsString setting. /// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read. /// public string? ResponseBody { get; set; } + /// /// The response headers. /// public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// /// Initializes a new instance of the class. /// @@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl { StatusCode = statusCode; } + + /// + /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::DeepInfra.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::DeepInfra.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseHeaders = responseHeaders; + return exception; + } + + /// + /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a . + /// Returns null when the header is missing or unparseable. Public so consumer code that observes + /// directly can recover the value without re-implementing the parser. + /// + public static global::System.TimeSpan? TryParseRetryAfter( + global::System.Collections.Generic.IDictionary>? headers) + { + if (headers == null) + { + return null; + } + + global::System.Collections.Generic.IEnumerable? values = null; + foreach (var entry in headers) + { + if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase)) + { + values = entry.Value; + break; + } + } + + if (values == null) + { + return null; + } + + string? raw = null; + foreach (var value in values) + { + if (!string.IsNullOrWhiteSpace(value)) + { + raw = value.Trim(); + break; + } + } + + if (string.IsNullOrEmpty(raw)) + { + return null; + } + + if (int.TryParse( + raw, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var seconds) && seconds >= 0) + { + return global::System.TimeSpan.FromSeconds(seconds); + } + + if (global::System.DateTimeOffset.TryParse( + raw, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var when)) + { + var delta = when - global::System.DateTimeOffset.UtcNow; + return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero; + } + + return null; + } } /// @@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } + + /// + /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static new global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::DeepInfra.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::DeepInfra.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + T? responseObject, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::DeepInfra.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CancelOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.CancelOpenaiBatch.g.cs new file mode 100644 index 00000000..f874bacf --- /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..28320aa4 --- /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..a13fd6a9 --- /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..64d40b83 --- /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..4997952c --- /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..8b4ced73 --- /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: 100 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListFilesAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + 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: 100 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListFilesAsResponseAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + 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..21e9176c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.OpenaiFiles.g.cs @@ -0,0 +1,1542 @@ + +#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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Purpose ?? string.Empty), + name: "\"purpose\""); + + for (var __iFile = 0; __iFile < request.File.Count; __iFile++) + { + var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File[__iFile]); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: $"\"file{__iFile}.bin\""); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Purpose ?? string.Empty), + name: "\"purpose\""); + + for (var __iFile = 0; __iFile < file.Count; __iFile++) + { + var __fileNameFile = fileFileNames != null && + __iFile < fileFileNames.Count && + fileFileNames[__iFile] != null + ? fileFileNames[__iFile] + : $"file{__iFile}.bin"; + var __contentFile = new global::System.Net.Http.StreamContent(file[__iFile]); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFile is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFile) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: $"\"{__fileNameFile}\""); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Purpose ?? string.Empty), + name: "\"purpose\""); + + for (var __iFile = 0; __iFile < file.Count; __iFile++) + { + var __fileNameFile = fileFileNames != null && + __iFile < fileFileNames.Count && + fileFileNames[__iFile] != null + ? fileFileNames[__iFile] + : $"file{__iFile}.bin"; + var __contentFile = new global::System.Net.Http.StreamContent(file[__iFile]); + __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFile is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFile) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFile, + name: "\"file\"", + fileName: $"\"{__fileNameFile}\""); + if (__contentFile.Headers.ContentDisposition != null) + { + __contentFile.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiFilesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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..47c7471a --- /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..6d72b190 --- /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..61898c0a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.FilesBatchesClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// File uploads and batch processing.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class FilesBatchesClient : global::DeepInfra.IFilesBatchesClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the FilesBatchesClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public FilesBatchesClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the FilesBatchesClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public FilesBatchesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the FilesBatchesClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public FilesBatchesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsDelete.g.cs new file mode 100644 index 00000000..1292fd98 --- /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..4f19e226 --- /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..3262f1b8 --- /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..ece7d73e --- /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..717b9f58 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.ContainerRentalsStart.g.cs @@ -0,0 +1,656 @@ + +#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)); + } + // 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..f9827ac2 --- /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..fd6922f5 --- /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..e7fbf3b0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.GpuRentalsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Rent dedicated GPU containers.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class GpuRentalsClient : global::DeepInfra.IGpuRentalsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the GpuRentalsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public GpuRentalsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the GpuRentalsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public GpuRentalsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the GpuRentalsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public GpuRentalsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountEmailValues.g.cs new file mode 100644 index 00000000..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.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuLimit.g.cs new file mode 100644 index 00000000..3e0239ab --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.AccountGpuLimit.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Account Gpu Limit + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AccountGpuLimitAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Account Gpu Limit + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AccountGpuLimitAsResponseAsync( + string? xiApiKey = default, + 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.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.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuLimitIncrease.g.cs new file mode 100644 index 00000000..874180ab --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.RequestGpuLimitIncrease.g.cs @@ -0,0 +1,59 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAccountClient + { + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RequestGpuLimitIncreaseAsResponseAsync( + + global::DeepInfra.GpuLimitRequestIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Request Gpu Limit Increase + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( + string gpuType, + int requestedLimit, + string reason, + string? xiApiKey = default, + 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.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..36217889 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAccountClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// User profile, team management, and rate limits.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAccountClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCatalog.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCatalog.g.cs new file mode 100644 index 00000000..8cfe4a3b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCatalog.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Catalog + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawCatalogAsync( + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Catalog + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> OpenclawCatalogAsResponseAsync( + string? xiApiKey = default, + 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.OpenclawCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCreate.g.cs new file mode 100644 index 00000000..57d61bde --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawCreate.g.cs @@ -0,0 +1,67 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Create + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawCreateAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Create + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawCreateAsResponseAsync( + + global::DeepInfra.OpenClawCreateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Create + /// + /// + /// + /// + /// Instance name + /// + /// + /// Agent type identifier
+ /// Default Value: openclaw + /// + /// + /// Plan identifier
+ /// Default Value: standard + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawCreateAsync( + string name, + string? xiApiKey = default, + string? 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.OpenclawDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawDelete.g.cs new file mode 100644 index 00000000..c352443c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawDelete.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Delete + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawDeleteAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Delete + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawDeleteAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawGet.g.cs new file mode 100644 index 00000000..eeb1347d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawGet.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Get + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawGetAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Get + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawGetAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawLaunchToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawLaunchToken.g.cs new file mode 100644 index 00000000..2bcebbc1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawLaunchToken.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawLaunchTokenAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Launch Token
+ /// Mint a single-use launch URL for the dashboard.
+ /// Called by the launcher page right when readyz flips ready. The launch URL
+ /// is used as a top-level navigation; /launch then sets the oc_auth cookie
+ /// and 302s into the proxied dashboard.
+ /// The user's bearer token is stashed in Redis under the token's jti and
+ /// retrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of
+ /// the URL and out of any signed payload while preserving the existing proxy
+ /// auth flow (oc_auth cookie value = bearer token).
+ /// Refuses instances whose agent_type has has_dashboard=False (e.g. hermes). + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawLaunchTokenAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawList.g.cs new file mode 100644 index 00000000..aac9920f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawList.g.cs @@ -0,0 +1,44 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawListAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw List + /// + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> OpenclawListAsResponseAsync( + global::DeepInfra.OpenclawListV1AgentsGetState? state = default, + string? xiApiKey = default, + 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.OpenclawListBackups.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawListBackups.g.cs new file mode 100644 index 00000000..7049f5e8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawListBackups.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw List Backups + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawListBackupsAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw List Backups + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> OpenclawListBackupsAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawRestoreBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawRestoreBackup.g.cs new file mode 100644 index 00000000..6dbd5f81 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawRestoreBackup.g.cs @@ -0,0 +1,42 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawRestoreBackupAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Restore Backup + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawRestoreBackupAsResponseAsync( + string instanceId, + string backupId, + string? xiApiKey = default, + 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.OpenclawStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStart.g.cs new file mode 100644 index 00000000..94ebeb81 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStart.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Start + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawStartAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Start + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawStartAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStop.g.cs new file mode 100644 index 00000000..5c568652 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawStop.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Stop + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawStopAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Stop + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawStopAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawTriggerBackup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawTriggerBackup.g.cs new file mode 100644 index 00000000..aba5e884 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawTriggerBackup.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawTriggerBackupAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Trigger Backup + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawTriggerBackupAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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.OpenclawUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdate.g.cs new file mode 100644 index 00000000..811d8593 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdate.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Update + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawUpdateAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Update + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawUpdateAsResponseAsync( + string instanceId, + + global::DeepInfra.OpenClawUpdateIn request, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Update + /// + /// + /// + /// + /// + /// Instance name + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawUpdateAsync( + string instanceId, + string name, + string? xiApiKey = default, + 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.OpenclawUpdateVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdateVersion.g.cs new file mode 100644 index 00000000..4525e98e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.OpenclawUpdateVersion.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IAgentsClient + { + /// + /// Openclaw Update Version + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenclawUpdateVersionAsync( + string instanceId, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Openclaw Update Version + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OpenclawUpdateVersionAsResponseAsync( + string instanceId, + string? xiApiKey = default, + 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..c95317ac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAgentsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Manage agent-framework instances (OpenClaw and friends).
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAgentsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs new file mode 100644 index 00000000..006d9c50 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioSpeech.g.cs @@ -0,0 +1,89 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// Text to convert to speech + /// + /// + /// Preset voices to use for the speech. + /// + /// + /// response format for the speech
+ /// Default Value: wav + /// + /// + /// speed of the speech
+ /// Default Value: 1F + /// + /// + /// Extra body parameters for the model. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( + string model, + string input, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + string? voice = default, + global::DeepInfra.TtsResponseFormat? responseFormat = default, + double? speed = default, + object? extraBody = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs new file mode 100644 index 00000000..3f0df9a8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranscriptions.g.cs @@ -0,0 +1,154 @@ +#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, + 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, + 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, + global::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..0877358c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.OpenaiAudioTranslations.g.cs @@ -0,0 +1,142 @@ +#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, + 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, + 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, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.g.cs new file mode 100644 index 00000000..5dd29774 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAudioClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible speech synthesis, transcription, and translation.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAudioClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.CreateApiToken.g.cs new file mode 100644 index 00000000..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.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..d3335277 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IAuthenticationClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// API tokens, SSH keys, scoped JWTs, and login flows.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IAuthenticationClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.AddFunds.g.cs new file mode 100644 index 00000000..4e8cd256 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.AddFunds.g.cs @@ -0,0 +1,63 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AddFundsAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AddFundsAsResponseAsync( + + global::DeepInfra.AddFundsIn request, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add Funds + /// + /// + /// Default Value: false + /// + /// + /// + /// Amount to add in cents + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AddFundsAsync( + int amount, + bool? useCheckout = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.BillingPortal.g.cs new file mode 100644 index 00000000..5f6c4989 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.BillingPortal.g.cs @@ -0,0 +1,34 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Billing Portal + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BillingPortalAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Billing Portal + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BillingPortalAsResponseAsync( + string? returnUrl = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.DeepstartApply.g.cs new file mode 100644 index 00000000..dd0cca18 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.DeepstartApply.g.cs @@ -0,0 +1,69 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Deepstart Apply + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeepstartApplyAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deepstart Apply + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeepstartApplyAsResponseAsync( + + global::DeepInfra.DeepStartApplicationIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deepstart Apply + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: pending + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeepstartApplyAsync( + string company, + string ceo, + string funding, + string foundedOn, + string website, + object? session = default, + string? id = default, + string? uid = default, + int? createdAt = default, + string? status = default, + string? deal = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetChecklist.g.cs new file mode 100644 index 00000000..43b235e1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetChecklist.g.cs @@ -0,0 +1,38 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetChecklistAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Checklist + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetChecklistAsResponseAsync( + bool? computeOwed = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetConfig.g.cs new file mode 100644 index 00000000..c4fa3929 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.GetConfig.g.cs @@ -0,0 +1,30 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Get Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetConfigAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Config + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetConfigAsResponseAsync( + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.ListInvoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.ListInvoices.g.cs new file mode 100644 index 00000000..90bb86ec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.ListInvoices.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListInvoicesAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Invoices + /// + /// + /// Default Value: 10 + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListInvoicesAsResponseAsync( + int? limit = default, + string? startingAfter = default, + string? invoiceType = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetConfig.g.cs new file mode 100644 index 00000000..9d370a23 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetConfig.g.cs @@ -0,0 +1,51 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Set Config + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SetConfigAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set Config + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SetConfigAsResponseAsync( + + global::DeepInfra.ConfigIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Set Config + /// + /// + /// + /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SetConfigAsync( + object? session = default, + double? limit = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetupTopup.g.cs new file mode 100644 index 00000000..735b9765 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.SetupTopup.g.cs @@ -0,0 +1,62 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Setup Topup + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SetupTopupAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Setup Topup + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SetupTopupAsResponseAsync( + + global::DeepInfra.TopUpIn request, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Setup Topup + /// + /// + /// + /// Amount to top up in cents
+ /// Default Value: 0 + /// + /// + /// Top up threshold in cents, if balance goes below this value, top up will be triggered
+ /// Default Value: 0 + /// + /// + /// If true, top up will be triggered when balance goes below threshold
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task SetupTopupAsync( + object? session = default, + int? amount = default, + int? threshold = default, + bool? enabled = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.Usage.g.cs new file mode 100644 index 00000000..f734d548 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.Usage.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UsageAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UsageAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageApiToken.g.cs new file mode 100644 index 00000000..e070a8fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageApiToken.g.cs @@ -0,0 +1,50 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UsageApiTokenAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage Api Token + /// + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UsageApiTokenAsResponseAsync( + string apiToken, + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageRent.g.cs new file mode 100644 index 00000000..43ac1273 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageRent.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UsageRentAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage Rent + /// + /// + /// start of period, in seconds since unix epoch + /// + /// + /// end of period, in seconds since unix epoch + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UsageRentAsResponseAsync( + int from, + int? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageTokens.g.cs new file mode 100644 index 00000000..d4868aa6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.UsageTokens.g.cs @@ -0,0 +1,46 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IBillingClient + { + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UsageTokensAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Usage Tokens + /// + /// + /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format + /// + /// + /// end of period (if missing a single month marked by from is return), same format as from + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UsageTokensAsResponseAsync( + string from, + string? to = default, + object? session = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.g.cs new file mode 100644 index 00000000..f8a1d2e1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IBillingClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Payment methods, usage tracking, and billing.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IBillingClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs new file mode 100644 index 00000000..e597df5f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessages.g.cs @@ -0,0 +1,101 @@ +#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? 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? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Anthropic Messages + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Default Value: false + /// + /// + /// Default Value: 1F + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AnthropicMessagesAsync( + string model, + global::System.Collections.Generic.IList messages, + string? anthropicVersion = default, + string? anthropicBeta = default, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? system = default, + global::System.Collections.Generic.IList? stopSequences = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + int? topK = default, + object? metadata = default, + global::System.Collections.Generic.IList? tools = default, + object? toolChoice = default, + global::DeepInfra.AnthropicThinkingConfig? thinking = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.AnthropicMessagesCountTokens.g.cs new file mode 100644 index 00000000..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..cd055644 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.OpenaiChatCompletions.g.cs @@ -0,0 +1,177 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// conversation messages: (user,assistant,tool)*,user including one system message anywhere + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// The maximum number of tokens to generate in the chat completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// A list of tools the model may call. Currently, only functions are supported as a tool. + /// + /// + /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. + /// + /// + /// streaming options + /// + /// + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// + /// + /// Reasoning configuration. + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Chat template kwargs. + /// + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( + string model, + global::System.Collections.Generic.IList> messages, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + bool? stream = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? maxTokens = default, + global::DeepInfra.AnyOf, object>? stop = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + int? n = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::System.Collections.Generic.IList? tools = default, + global::DeepInfra.AnyOf? toolChoice = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + bool? logprobs = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, + global::DeepInfra.ChatReasoningSettings? reasoning = default, + string? promptCacheKey = default, + object? chatTemplateKwargs = default, + bool? continueFinalMessage = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.g.cs new file mode 100644 index 00000000..44e775ec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IChatCompletionsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IChatCompletionsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreate.g.cs new file mode 100644 index 00000000..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..5fe5c268 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployCreateLlm.g.cs @@ -0,0 +1,95 @@ +#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 + /// + /// + /// 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 + /// + /// + /// Engine tuning knobs. Values are validated on submission; unsupported or out-of-range values are rejected. + /// + /// + /// Apply a DeepInfra preset (base_model deploys only). + /// + /// Per-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, + int? maxBatchSize = default, + global::DeepInfra.HFWeights? hf = default, + string? baseModel = default, + string? containerImage = default, + global::DeepInfra.ScaleSettings? settings = default, + global::System.Collections.Generic.IList? extraArgs = default, + global::DeepInfra.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..18791c2c --- /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,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,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..ae2e62ee --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.DeployLlmPresets.g.cs @@ -0,0 +1,52 @@ +#nullable enable + +namespace DeepInfra +{ + public partial interface IDedicatedModelsClient + { + /// + /// Deploy Llm Presets
+ /// DeepInfra-tested preset deploy configs for ``hf_repo_id`` (HF org/name), for
+ /// the deploy dashboard to pre-fill. An empty list — the common case — means none.
+ /// Omit ``engine`` to get presets across all engines. + ///
+ /// + /// + /// + /// + /// + /// Per-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? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Deploy Llm Presets
+ /// DeepInfra-tested preset deploy configs for ``hf_repo_id`` (HF org/name), for
+ /// the deploy dashboard to pre-fill. An empty list — the common case — means none.
+ /// Omit ``engine`` to get presets across all engines. + ///
+ /// + /// + /// + /// + /// + /// Per-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? 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.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..acb0e30e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDedicatedModelsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Deploy and manage private model instances with autoscaling.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IDedicatedModelsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountEmailValues.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountEmailValues.g.cs deleted file mode 100644 index e0e64566..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountEmailValues.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Email Values - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountEmailValuesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountGpuLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountGpuLimit.g.cs deleted file mode 100644 index 60448a24..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountGpuLimit.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Gpu Limit - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountGpuLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountRateLimit.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountRateLimit.g.cs deleted file mode 100644 index a1808c7f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountRateLimit.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Rate Limit - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountRateLimitAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountUpdateDetails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountUpdateDetails.g.cs deleted file mode 100644 index 6aa1c410..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AccountUpdateDetails.g.cs +++ /dev/null @@ -1,73 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Account Update Details - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - - global::DeepInfra.MeIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Account Update Details - /// - /// - /// - /// Personal name - /// - /// - /// First name of the user - /// - /// - /// Last name of the user - /// - /// - /// Country of the user - /// - /// - /// - /// - /// Company name - /// - /// - /// Company website address - /// - /// - /// Job title of the user, e.g. 'Software Engineer' - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// - /// Short description of the use case for the account - /// - /// - /// Short description of how the user found out about DeepInfra - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AccountUpdateDetailsAsync( - string? xiApiKey = default, - string? name = default, - string? firstName = default, - string? lastName = default, - string? country = default, - string? email = default, - bool? isBusinessAccount = default, - string? company = default, - string? website = default, - string? title = default, - string? displayName = default, - string? useCase = default, - string? attribution = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs deleted file mode 100644 index 765b1215..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Add Funds - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AddFundsAsync( - - global::DeepInfra.AddFundsIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Add Funds - /// - /// - /// - /// Amount to add in cents - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AddFundsAsync( - int amount, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessages.g.cs deleted file mode 100644 index 31dfada4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessages.g.cs +++ /dev/null @@ -1,71 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesAsync( - - global::DeepInfra.AnthropicMessagesIn request, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Anthropic Messages - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: false - /// - /// - /// Default Value: 1F - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - string? anthropicVersion = default, - string? anthropicBeta = default, - string? xDeepinfraSource = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? stopSequences = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - int? topK = default, - object? metadata = default, - global::System.Collections.Generic.IList? tools = default, - object? toolChoice = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessagesCountTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessagesCountTokens.g.cs deleted file mode 100644 index 0c61a16d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AnthropicMessagesCountTokens.g.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - - global::DeepInfra.AnthropicTokenCountRequest request, - string? xApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Anthropic Messages Count Tokens - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task AnthropicMessagesCountTokensAsync( - string model, - global::System.Collections.Generic.IList messages, - string? xApiKey = default, - global::DeepInfra.AnyOf, object>? system = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnthropicThinkingConfig? thinking = default, - object? toolChoice = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs index 8723e29f..671e4325 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Authorizations.Bearer.g.cs @@ -9,6 +9,7 @@ public partial interface IDeepInfraClient /// Authorize using bearer authentication. /// /// + public void AuthorizeUsingBearer( string apiKey); } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs deleted file mode 100644 index dfe3c5a3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Billing Portal - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task BillingPortalAsync( - string? returnUrl = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CliVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CliVersion.g.cs deleted file mode 100644 index f9bde8c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CliVersion.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Cli Version - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CliVersionAsync( - string version, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsDelete.g.cs deleted file mode 100644 index 6b2caa0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsDelete.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Delete - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsDeleteAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGet.g.cs deleted file mode 100644 index f0200fa1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGet.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Get - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsGetAsync( - string containerId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGetParams.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGetParams.g.cs deleted file mode 100644 index 6a089385..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsGetParams.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Get Params - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsGetParamsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsList.g.cs deleted file mode 100644 index c9029e32..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsList.g.cs +++ /dev/null @@ -1,22 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals List - /// - /// - /// whether to return active or inactive containers
- /// Default Value: active - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ContainerRentalsListAsync( - global::DeepInfra.ContainerRentalsListV1ContainersGetState? state = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsStart.g.cs deleted file mode 100644 index eb67a4d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsStart.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Start - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - - global::DeepInfra.ContainerRentalStartIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Container Rentals Start - /// - /// - /// - /// Container Name - /// - /// - /// GPU config - /// - /// - /// Container Image - /// - /// - /// Cloud Init User Data - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsStartAsync( - string name, - string gpuConfig, - string containerImage, - string cloudInitUserData, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsUpdate.g.cs deleted file mode 100644 index ed8fdb1b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ContainerRentalsUpdate.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Container Rentals Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - - global::DeepInfra.ContainerRentalUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Container Rentals Update - /// - /// - /// - /// - /// Container Name - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ContainerRentalsUpdateAsync( - string containerId, - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateApiToken.g.cs deleted file mode 100644 index 9f895d8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateApiToken.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiTokenAsync( - - global::DeepInfra.ApiTokenIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateApiTokenAsync( - string name, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateLora.g.cs deleted file mode 100644 index a5bdb0ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateLora.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Lora - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateLoraAsync( - - global::DeepInfra.CreateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Lora - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateLoraAsync( - string baseModel, - string loraName, - global::DeepInfra.SourceModel source, - bool @private, - string? xiApiKey = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch.g.cs deleted file mode 100644 index 208f34cc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatchAsync( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch2.g.cs deleted file mode 100644 index 1246c5e1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateOpenaiBatch2.g.cs +++ /dev/null @@ -1,45 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - - global::DeepInfra.OpenAIBatchesIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Openai Batch - /// - /// - /// - /// The ID of an uploaded file that contains requests for the new batch. - /// - /// - /// The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/completions are supported. - /// - /// - /// The time frame within which the batch should be processed. Currently only 24h is supported. - /// - /// - /// Optional metadata to be stored with the batch. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateOpenaiBatch2Async( - string inputFileId, - global::DeepInfra.OpenAIBatchesInEndpoint endpoint, - string? xiApiKey = default, - string completionWindow = "24h", - object? metadata = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateScopedJwt.g.cs deleted file mode 100644 index 2cc8e8e9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateScopedJwt.g.cs +++ /dev/null @@ -1,47 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateScopedJwtAsync( - - global::DeepInfra.ScopedJWTIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Scoped Jwt - /// - /// - /// - /// - /// allow inference only to the specified model names - /// - /// - /// how many seconds in the future should the token be valid for - /// - /// - /// unix timestamp when the token should expire - /// - /// - /// only allow spending that much USD until the token becomes invalid - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateScopedJwtAsync( - string apiKeyName, - string? xiApiKey = default, - global::System.Collections.Generic.IList? models = default, - int? expiresDelta = default, - int? expiresAt = default, - double? spendingLimit = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateSshKey.g.cs deleted file mode 100644 index fa2db53f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateSshKey.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateSshKeyAsync( - - global::DeepInfra.SshKeyIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Ssh Key - /// - /// - /// - /// SSH Key name - /// - /// - /// SSH Key content - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateSshKeyAsync( - string name, - string key, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateVoice.g.cs deleted file mode 100644 index 0b316c10..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.CreateVoice.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateVoiceAsync( - - global::DeepInfra.BodyCreateVoiceV1VoicesAddPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Create Voice
- /// Create a new voice - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task CreateVoiceAsync( - string name, - string description, - global::System.Collections.Generic.IList files, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs deleted file mode 100644 index 56b327da..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.cs +++ /dev/null @@ -1,51 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deepstart Apply - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeepstartApplyAsync( - - global::DeepInfra.DeepStartApplicationIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deepstart Apply - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: pending - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeepstartApplyAsync( - string company, - string ceo, - string funding, - string foundedOn, - string website, - object? session = default, - string? id = default, - string? uid = default, - int? createdAt = default, - string? status = default, - string? deal = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteAccount.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteAccount.g.cs deleted file mode 100644 index 8fc43fa5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteAccount.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Account - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteAccountAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteApiToken.g.cs deleted file mode 100644 index fefb0b5e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteApiToken.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLora.g.cs deleted file mode 100644 index cdca8922..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLora.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Lora - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLoraModel.g.cs deleted file mode 100644 index a5167fc7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteLoraModel.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteLoraModelAsync( - string loraModelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteSshKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteSshKey.g.cs deleted file mode 100644 index 6a8688fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteSshKey.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Ssh Key - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteSshKeyAsync( - string sshKeyId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteVoice.g.cs deleted file mode 100644 index 340f75c4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeleteVoice.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Delete Voice - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeleteVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreate.g.cs deleted file mode 100644 index 9481fc5a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreate.g.cs +++ /dev/null @@ -1,42 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Create - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateAsync( - - global::DeepInfra.DeployModelIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Create - /// - /// - /// - /// namespace for the model name
- /// Default Value: cnt - /// - /// - /// model name in specified provider - /// - /// - /// A specific revision, if left empty uses the last one - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateAsync( - string modelName, - string? xiApiKey = default, - global::DeepInfra.ModelProvider? provider = default, - string? version = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateHf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateHf.g.cs deleted file mode 100644 index 05b2d33a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateHf.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Create Hf - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateHfAsync( - - global::DeepInfra.HFModel request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Create Hf - /// - /// - /// - /// Model Id from huggingface - /// - /// - /// Task - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateHfAsync( - string modelName, - string? xiApiKey = default, - string? task = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateLlm.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateLlm.g.cs deleted file mode 100644 index 9fb25389..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployCreateLlm.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Create Llm - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateLlmAsync( - - global::DeepInfra.DeployLLMIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Create Llm - /// - /// - /// - /// model name for deepinfra (username/mode-name format) - /// - /// - /// The type of GPU the deployment is running on - /// - /// - /// Number of GPUs used by one instance
- /// Default Value: 1 - /// - /// - /// Maximum number of concurrent requests
- /// Default Value: 96 - /// - /// - /// - /// Base public model - /// - /// - /// Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4) - /// - /// - /// - /// Extra command line arguments for custom deployments - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployCreateLlmAsync( - string modelName, - global::DeepInfra.DeployGPUs gpu, - string? xiApiKey = default, - int? numGpus = default, - int? maxBatchSize = default, - global::DeepInfra.HFWeights? hf = default, - string? baseModel = default, - string? containerImage = default, - global::DeepInfra.ScaleSettings? settings = default, - global::System.Collections.Generic.IList? extraArgs = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDelete.g.cs deleted file mode 100644 index 6d516dca..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDelete.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Delete - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployDeleteAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDetailedStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDetailedStats.g.cs deleted file mode 100644 index 8e485533..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployDetailedStats.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Detailed Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s, m, h, d, w - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployDetailedStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployGpuAvailability.g.cs deleted file mode 100644 index 5bcb9dc0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployGpuAvailability.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployList2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployList2.g.cs deleted file mode 100644 index 208e51d1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployList2.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy List - /// - /// - /// A list of statuses that should be returned, separated by comma. Allowed values in the list are: initializing,downloading,deploying,running,stopped,failed,deleted - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> DeployList2Async( - string? status = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStart.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStart.g.cs deleted file mode 100644 index 3326b1b1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStart.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Start
- /// Start a stopped deployment. Re-creates pods via auto-scaling. - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStartAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStats.g.cs deleted file mode 100644 index 8b5c9b0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStats.g.cs +++ /dev/null @@ -1,28 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Stats - /// - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStatsAsync( - string deployId, - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStatus.g.cs deleted file mode 100644 index bb71473d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStatus.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Status - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStatusAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStop.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStop.g.cs deleted file mode 100644 index eb2014ff..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployStop.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Stop
- /// Stop a running deployment. Terminates pods. Can be restarted later. - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployStopAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployUpdate.g.cs deleted file mode 100644 index 7e922a5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeployUpdate.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - - global::DeepInfra.DeployLLMUpdateIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Deploy Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeployUpdateAsync( - string deployId, - global::DeepInfra.ScaleSettings settings, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentLogsQuery.g.cs deleted file mode 100644 index e3b33b98..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentLogsQuery.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deployment Logs Query
- /// Query deployment logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// the pod name to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task DeploymentLogsQueryAsync( - string deployId, - string? podName = default, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentStats.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentStats.g.cs deleted file mode 100644 index 6bc5c5d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeploymentStats.g.cs +++ /dev/null @@ -1,26 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Deployment Stats - /// - /// - /// start of period, unix ts or 'now-5h', supported units s(ec), m(min), h(our), d(ay), w(eek), M(onth) - /// - /// - /// end of period, unix ts or now-relative, check from, defaults to now
- /// Default Value: now - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> DeploymentStatsAsync( - string from, - string? to = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ExportApiTokenToVercel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ExportApiTokenToVercel.g.cs deleted file mode 100644 index 67f4eb8e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ExportApiTokenToVercel.g.cs +++ /dev/null @@ -1,43 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - - global::DeepInfra.ApiTokenVercelExportIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Export Api Token To Vercel - /// - /// - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ExportApiTokenToVercelAsync( - string apiToken, - string projectIdOrName, - bool isSensitive, - bool envDevelopment, - bool envPreview, - bool envProduction, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiToken.g.cs deleted file mode 100644 index a4d5facd..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiToken.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Api Token - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetApiTokenAsync( - string apiToken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiTokens.g.cs deleted file mode 100644 index d5f26978..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetApiTokens.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Api Tokens - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetApiTokensAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs deleted file mode 100644 index 0c7b2103..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Checklist - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetChecklistAsync( - bool? computeOwed = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs deleted file mode 100644 index a75d3a6e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Config - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetConfigAsync( - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetHardware.g.cs deleted file mode 100644 index d8abe592..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetHardware.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Hardware - /// - /// - /// Model name (NVIDIA NemoClaw format) - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetHardwareAsync( - string model, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLiveMetrics.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLiveMetrics.g.cs deleted file mode 100644 index 9a9df7b2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLiveMetrics.g.cs +++ /dev/null @@ -1,16 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Live Metrics
- /// Get the latest values for the Live metrics section on the web front page. - ///
- /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetLiveMetricsAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLora.g.cs deleted file mode 100644 index 079b0293..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLora.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Lora - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetLoraAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLoraStatus.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLoraStatus.g.cs deleted file mode 100644 index 3e24b1cf..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetLoraStatus.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Lora Status - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetLoraStatusAsync( - string loraName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetModelLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetModelLoras.g.cs deleted file mode 100644 index 18e2eac9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetModelLoras.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Model Loras - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetModelLorasAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetRequestCosts.g.cs deleted file mode 100644 index e5f1ae58..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetRequestCosts.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetRequestCostsAsync( - - global::DeepInfra.RequestCostQuery request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Get Request Costs - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetRequestCostsAsync( - global::System.Collections.Generic.IList requestIds, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetSshKeys.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetSshKeys.g.cs deleted file mode 100644 index adb520b4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetSshKeys.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Ssh Keys - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> GetSshKeysAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetUserLoras.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetUserLoras.g.cs deleted file mode 100644 index 425abf8f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetUserLoras.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get User Loras - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetUserLorasAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoice.g.cs deleted file mode 100644 index 4991c835..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoice.g.cs +++ /dev/null @@ -1,20 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Voice
- /// Get a voice by its id - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetVoiceAsync( - string voiceId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoices.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoices.g.cs deleted file mode 100644 index b69275ea..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetVoices.g.cs +++ /dev/null @@ -1,18 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Get Voices
- /// Get available voices for a given user - ///
- /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GetVoicesAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubCliLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubCliLogin.g.cs deleted file mode 100644 index efd3bda9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubCliLogin.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Github Cli Login
- /// deepctl is calling this request waiting for auth token during login.
- /// The token is stored in /github/callback - ///
- /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GithubCliLoginAsync( - string loginId, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubLogin.g.cs deleted file mode 100644 index 961b7240..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GithubLogin.g.cs +++ /dev/null @@ -1,24 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Github Login
- /// Initiate github SSO login flow. Callback is /github/callback - ///
- /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task GithubLoginAsync( - string? loginId = default, - string? origin = default, - string? deal = default, - string? tiToken = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceDeploy.g.cs deleted file mode 100644 index 65bf63d8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceDeploy.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Inference Deploy - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task InferenceDeployAsync( - string deployId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceModel.g.cs deleted file mode 100644 index f50e2976..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InferenceModel.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Inference Model - /// - /// - /// - /// model version to run inference against - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task InferenceModelAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InspectScopedJwt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InspectScopedJwt.g.cs deleted file mode 100644 index 6e129584..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.InspectScopedJwt.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Inspect Scoped Jwt - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task InspectScopedJwtAsync( - string jwtoken, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles.g.cs deleted file mode 100644 index 5522e649..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListFilesAsync( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles2.g.cs deleted file mode 100644 index 123b7e69..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ListFiles2.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// List Files - /// - /// - /// - /// - /// - /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ListFiles2Async( - string? after = default, - string? purpose = default, - string? order = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.LogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.LogsQuery.g.cs deleted file mode 100644 index 2575b3ab..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.LogsQuery.g.cs +++ /dev/null @@ -1,40 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Logs Query
- /// Query inference logs.
- /// * Without timestamps (from/to) returns last `limit` messages (in last month).
- /// * With `from` only, returns first `limit` messages after `from` (inclusive).
- /// * With `to` only, returns last `limit` messages before `to` (inclusive).
- /// * With both `from` and `to`, return the first `limit` messages after `from`, but not later than `to`.
- /// * `from` and `to` should be no more than a month apart. - ///
- /// - /// the deploy id to get the logs from - /// - /// - /// start of period, in fractional seconds since unix epoch (inclusive) - /// - /// - /// end of period, in fractional seconds since unix epoch (exclusive) - /// - /// - /// how many items to return at most (default 100, in [1, 1000])
- /// Default Value: 100 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task LogsQueryAsync( - string deployId, - string? from = default, - string? to = default, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Me.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Me.g.cs deleted file mode 100644 index bb1321ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Me.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Me - /// - /// - /// Default Value: false - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task MeAsync( - bool? checklist = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelDelete.g.cs deleted file mode 100644 index f1dd4069..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelDelete.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Delete - /// - /// - /// - /// delete a particular version, pass 'ALL' to wipe everything - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelDeleteAsync( - string modelName, - string version, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamiliesNames.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamiliesNames.g.cs deleted file mode 100644 index 824a2e2f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamiliesNames.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Families Names - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelFamiliesNamesAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamily.g.cs deleted file mode 100644 index ac5aaa35..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelFamily.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Family - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelFamilyAsync( - string familyName, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelMetaUpdate.g.cs deleted file mode 100644 index bfa90cf0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelMetaUpdate.g.cs +++ /dev/null @@ -1,61 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Meta Update - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - - global::DeepInfra.ModelMetaIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Meta Update - /// - /// - /// - /// - /// short model description in plain text - /// - /// - /// source code project link (empty to delete) - /// - /// - /// paper/research link (empty to delete) - /// - /// - /// usage license link (empty to delete) - /// - /// - /// markdown flavored model readme - /// - /// - /// dataurl or regular url to cover image (empty to delete) - /// - /// - /// model type - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelMetaUpdateAsync( - string modelName, - string? xiApiKey = default, - string? description = default, - string? githubUrl = default, - string? paperUrl = default, - string? licenseUrl = default, - string? readme = default, - string? coverImgUrl = default, - global::DeepInfra.HFTasksE? reportedType = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelPublicity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelPublicity.g.cs deleted file mode 100644 index e018b85c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelPublicity.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Publicity - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - - global::DeepInfra.ModelPublicityIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Model Publicity - /// - /// - /// - /// - /// whether to make the model public of private - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelPublicityAsync( - string modelName, - bool @public, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelSchema.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelSchema.g.cs deleted file mode 100644 index 22836ef5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelSchema.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Schema - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelSchemaAsync( - string modelName, - global::DeepInfra.SchemaVariantKey variantKey, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelVersions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelVersions.g.cs deleted file mode 100644 index b4f7a214..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelVersions.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Model Versions - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelVersionsAsync( - string modelName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsDeploymentList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsDeploymentList.g.cs deleted file mode 100644 index dc1feb9e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsDeploymentList.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Deployment List - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsDeploymentListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsFeatured.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsFeatured.g.cs deleted file mode 100644 index 01f5dc4f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsFeatured.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Featured - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsFeaturedAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsInfo.g.cs deleted file mode 100644 index b9dac807..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsInfo.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Info - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task ModelsInfoAsync( - string modelName, - string? version = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsList.g.cs deleted file mode 100644 index 5409051d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsList.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models List - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsListAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsLoraList.g.cs deleted file mode 100644 index 65ab29d0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.ModelsLoraList.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Models Lora List - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> ModelsLoraListAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OktaLogin.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OktaLogin.g.cs deleted file mode 100644 index 362dd22a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OktaLogin.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Okta Login - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OktaLoginAsync( - string teamId, - string? origin = default, - string? loginId = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech.g.cs deleted file mode 100644 index 1ddf9f41..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeechAsync( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech2.g.cs deleted file mode 100644 index 657d5d97..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioSpeech2.g.cs +++ /dev/null @@ -1,63 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - - global::DeepInfra.OpenAITextToSpeechIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Speech - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// Text to convert to speech - /// - /// - /// Preset voices to use for the speech. - /// - /// - /// response format for the speech
- /// Default Value: wav - /// - /// - /// speed of the speech
- /// Default Value: 1F - /// - /// - /// Extra body parameters for the model. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioSpeech2Async( - string model, - string input, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - string? voice = default, - global::DeepInfra.TtsResponseFormat? responseFormat = default, - double? speed = default, - object? extraBody = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions.g.cs deleted file mode 100644 index 63718d0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptionsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions2.g.cs deleted file mode 100644 index 5428556e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranscriptions2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Transcriptions - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranscriptions2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? language = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Collections.Generic.IList? timestampGranularities = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations.g.cs deleted file mode 100644 index c4c5e60e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslationsAsync( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations2.g.cs deleted file mode 100644 index 4b00a5c3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiAudioTranslations2.g.cs +++ /dev/null @@ -1,49 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Audio Translations - /// - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiAudioTranslations2Async( - byte[] file, - string filename, - string model, - string? xDeepinfraSource = default, - string? xiApiKey = default, - string? prompt = default, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? responseFormat = default, - double? temperature = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs deleted file mode 100644 index 3cc76883..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs +++ /dev/null @@ -1,139 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletionsAsync( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs deleted file mode 100644 index 6fddaa52..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs +++ /dev/null @@ -1,139 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - - global::DeepInfra.OpenAIChatCompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Chat Completions - /// - /// - /// - /// - /// model name - /// - /// - /// conversation messages: (user,assistant,tool)*,user including one system message anywhere - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// The maximum number of tokens to generate in the chat completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// A list of tools the model may call. Currently, only functions are supported as a tool. - /// - /// - /// Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present. - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`. - /// - /// - /// streaming options - /// - /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. - /// - /// - /// Reasoning configuration. - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Chat template kwargs. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiChatCompletions2Async( - string model, - global::System.Collections.Generic.IList> messages, - string? xDeepinfraSource = default, - string? xiApiKey = default, - bool? stream = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? maxTokens = default, - global::DeepInfra.AnyOf, object>? stop = default, - int? n = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::System.Collections.Generic.IList? tools = default, - global::DeepInfra.AnyOf? toolChoice = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - bool? logprobs = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort = default, - global::DeepInfra.ChatReasoningSettings? reasoning = default, - string? promptCacheKey = default, - object? chatTemplateKwargs = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions.g.cs deleted file mode 100644 index 444fc88f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions.g.cs +++ /dev/null @@ -1,135 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletionsAsync( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions2.g.cs deleted file mode 100644 index 52cd0420..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiCompletions2.g.cs +++ /dev/null @@ -1,135 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Completions - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletions2Async( - - global::DeepInfra.OpenAICompletionsIn request, - string? xDeepinfraSource = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Completions - /// - /// - /// - /// - /// model name - /// - /// - /// input prompt - a single string is currently supported - /// - /// - /// The maximum number of tokens to generate in the completion.
- /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. - /// - /// - /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
- /// Default Value: 1F - /// - /// - /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- /// Default Value: 1F - /// - /// - /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
- /// Default Value: 0F - /// - /// - /// Sample from the best k (number of) tokens. 0 means off
- /// Default Value: 0 - /// - /// - /// number of sequences to return
- /// Default Value: 1 - /// - /// - /// whether to stream the output via SSE or return the full response
- /// Default Value: false - /// - /// - /// return top tokens and their log-probabilities - /// - /// - /// return prompt as part of the respons - /// - /// - /// up to 16 sequences where the API will stop generating further tokens - /// - /// - /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
- /// Default Value: 0 - /// - /// - /// The format of the response. Currently, only json is supported. - /// - /// - /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
- /// Default Value: 1 - /// - /// - /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. - /// - /// - /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. - /// - /// - /// streaming options - /// - /// - /// List of token IDs that will stop generation when encountered - /// - /// - /// return tokens as token ids - /// - /// - /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. - /// - /// - /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiCompletions2Async( - string model, - global::DeepInfra.AnyOf> prompt, - string? xDeepinfraSource = default, - string? xiApiKey = default, - int? maxTokens = default, - double? temperature = default, - double? topP = default, - double? minP = default, - int? topK = default, - int? n = default, - bool? stream = default, - int? logprobs = default, - bool? echo = default, - global::DeepInfra.AnyOf, object>? stop = default, - double? presencePenalty = default, - double? frequencyPenalty = default, - global::DeepInfra.AnyOf? responseFormat = default, - double? repetitionPenalty = default, - string? user = default, - int? seed = default, - global::DeepInfra.StreamOptions? streamOptions = default, - global::System.Collections.Generic.IList? stopTokenIds = default, - bool? returnTokensAsTokenIds = default, - string? promptCacheKey = default, - global::DeepInfra.CompletionMultiModalData? data = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.cs deleted file mode 100644 index fd59a141..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.cs +++ /dev/null @@ -1,58 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddingsAsync( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings2.g.cs deleted file mode 100644 index de1d0eef..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings2.g.cs +++ /dev/null @@ -1,58 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - - global::DeepInfra.OpenAIEmbeddingsIn request, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Embeddings - /// - /// - /// - /// - /// - /// The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). - /// - /// - /// model name - /// - /// - /// sequences to embed - /// - /// - /// format used when encoding
- /// Default Value: float - /// - /// - /// The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiEmbeddings2Async( - string model, - global::DeepInfra.AnyOf, string> input, - string? xDeepinfraSource = default, - string? userAgent = default, - string? xiApiKey = default, - global::DeepInfra.ServiceTier? serviceTier = default, - global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat = default, - int? dimensions = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles.g.cs deleted file mode 100644 index 2afa2a4a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFilesAsync( - - global::DeepInfra.BodyOpenaiFilesV1FilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFilesAsync( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles2.g.cs deleted file mode 100644 index 62c4535c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiFiles2.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Files - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFiles2Async( - - global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Files - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiFiles2Async( - string purpose, - global::System.Collections.Generic.IList file, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits.g.cs deleted file mode 100644 index 0da46fa9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits.g.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - - global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEditsAsync( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits2.g.cs deleted file mode 100644 index 95dfd4fa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesEdits2.g.cs +++ /dev/null @@ -1,41 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - - global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Edits
- /// Edit image using OpenAI Images Edits API - ///
- /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesEdits2Async( - byte[] image, - string imagename, - string prompt, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesEditsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations.g.cs deleted file mode 100644 index 64859cc6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations.g.cs +++ /dev/null @@ -1,66 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerationsAsync( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations2.g.cs deleted file mode 100644 index 11bdf7c4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesGenerations2.g.cs +++ /dev/null @@ -1,66 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - - global::DeepInfra.OpenAIImagesGenerationsIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Generations
- /// Generate image using OpenAI Images API - ///
- /// - /// - /// The model to use for image generation. - /// - /// - /// The number of images to generate.
- /// Default Value: 1 - /// - /// - /// The format in which the generated images are returned. Currently only b64_json is supported.
- /// Default Value: b64_json - /// - /// - /// The size of the generated images. Available sizes depend on the model.
- /// Default Value: 1024x1024 - /// - /// - /// A unique identifier representing your end-user, which can help to monitor and detect abuse. - /// - /// - /// A text description of desired image(s). - /// - /// - /// The quality of the image that will be generated. - /// - /// - /// The style of the generated images. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesGenerations2Async( - string model, - string prompt, - string? xiApiKey = default, - int? n = default, - global::DeepInfra.OpenAIImagesResponseFormat? responseFormat = default, - string? size = default, - string? user = default, - string? quality = default, - string? style = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations.g.cs deleted file mode 100644 index 60d58f36..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - - global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariationsAsync( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations2.g.cs deleted file mode 100644 index 55a16d5a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiImagesVariations2.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - - global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Openai Images Variations
- /// Generate a similar image using OpenAI Images Variations API - ///
- /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiImagesVariations2Async( - byte[] image, - string imagename, - string model, - string? xiApiKey = default, - global::DeepInfra.OpenAIImagesVariationsIn? inp = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels.g.cs deleted file mode 100644 index 3b40f666..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiModelsAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels2.g.cs deleted file mode 100644 index 977c6484..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiModels2.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openai Models - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenaiModels2Async( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenrouterModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenrouterModels.g.cs deleted file mode 100644 index ba282d32..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenrouterModels.g.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Openrouter Models - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task OpenrouterModelsAsync( - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.PrivateModelsList.g.cs deleted file mode 100644 index 94c17a1c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.PrivateModelsList.g.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Private Models List - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task> PrivateModelsListAsync( - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RentGpuAvailability.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RentGpuAvailability.g.cs deleted file mode 100644 index e7d204fc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RentGpuAvailability.g.cs +++ /dev/null @@ -1,21 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Rent Gpu Availability - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RentGpuAvailabilityAsync( - string? source = default, - string? baseModel = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestGpuLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestGpuLimitIncrease.g.cs deleted file mode 100644 index 76d1d625..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestGpuLimitIncrease.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - - global::DeepInfra.GpuLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Request Gpu Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestGpuLimitIncreaseAsync( - string gpuType, - int requestedLimit, - string reason, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestRateLimitIncrease.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestRateLimitIncrease.g.cs deleted file mode 100644 index d873d65b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RequestRateLimitIncrease.g.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Request Rate Limit Increase - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - - global::DeepInfra.RateLimitRequestIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Request Rate Limit Increase - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RequestRateLimitIncreaseAsync( - int rateLimit, - string reason, - string? xiApiKey = default, - int? tpmRateLimit = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch.g.cs deleted file mode 100644 index cfaa5955..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatchAsync( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch2.g.cs deleted file mode 100644 index 28976379..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatch2.g.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batch - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatch2Async( - string batchId, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches.g.cs deleted file mode 100644 index 123004b7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatchesAsync( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches2.g.cs deleted file mode 100644 index 4509e69b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.RetrieveOpenaiBatches2.g.cs +++ /dev/null @@ -1,23 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Retrieve Openai Batches - /// - /// - /// - /// Default Value: 20 - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task RetrieveOpenaiBatches2Async( - string after, - int? limit = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs deleted file mode 100644 index 9f6e6736..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Set Config - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetConfigAsync( - - global::DeepInfra.ConfigIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Set Config - /// - /// - /// - /// Set usage limit (in USD). Negative means no limit.null/not-set means don't change it - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetConfigAsync( - object? session = default, - double? limit = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs deleted file mode 100644 index 0aa024e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.cs +++ /dev/null @@ -1,44 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Setup Topup - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetupTopupAsync( - - global::DeepInfra.TopUpIn request, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Setup Topup - /// - /// - /// - /// Amount to top up in cents
- /// Default Value: 0 - /// - /// - /// Top up threshold in cents, if balance goes below this value, top up will be triggered
- /// Default Value: 0 - /// - /// - /// If true, top up will be triggered when balance goes below threshold
- /// Default Value: true - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SetupTopupAsync( - object? session = default, - int? amount = default, - int? threshold = default, - bool? enabled = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SubmitFeedback.g.cs deleted file mode 100644 index 0035475e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SubmitFeedback.g.cs +++ /dev/null @@ -1,39 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SubmitFeedbackAsync( - - global::DeepInfra.FeedbackIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Submit Feedback
- /// Submit feedback - ///
- /// - /// - /// The message you'd like to send to deepinfra team - /// - /// - /// Optional contact email to reach you back - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task SubmitFeedbackAsync( - string message, - string? xiApiKey = default, - string? contactEmail = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TeamSetDisplayName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TeamSetDisplayName.g.cs deleted file mode 100644 index c1b22e7e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TeamSetDisplayName.g.cs +++ /dev/null @@ -1,33 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Team Set Display Name - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - - global::DeepInfra.DisplayNameIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Team Set Display Name - /// - /// - /// - /// String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes. - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TeamSetDisplayNameAsync( - string displayName, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeech.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeech.g.cs deleted file mode 100644 index b29adca0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeech.g.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text To Speech - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeechStream.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeechStream.g.cs deleted file mode 100644 index 9ee8131a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.TextToSpeechStream.g.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - - global::DeepInfra.ElevenLabsTextToSpeechIn request, - string? outputFormat = default, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Text To Speech Stream - /// - /// - /// - /// - /// - /// Text to convert to speech - /// - /// - /// Model ID to use for the conversion
- /// Default Value: hexgrad/Kokoro-82M - /// - /// - /// Output format for the speech
- /// Default Value: wav - /// - /// - /// ISO 639-1, 2 letter language code - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task TextToSpeechStreamAsync( - string voiceId, - string text, - string? outputFormat = default, - string? xiApiKey = default, - string? modelId = default, - global::DeepInfra.TtsResponseFormat? requestOutputFormat = default, - string? languageCode = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateLora.g.cs deleted file mode 100644 index b91d8312..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateLora.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Update Lora - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - - global::DeepInfra.UpdateLoraApiRequest request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update Lora - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateLoraAsync( - string loraName, - string? xiApiKey = default, - bool? @private = default, - string? description = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateVoice.g.cs deleted file mode 100644 index 9254ec66..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UpdateVoice.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Update Voice - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - - global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Update Voice - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UpdateVoiceAsync( - string voiceId, - string name, - string description, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UploadLoraModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UploadLoraModel.g.cs deleted file mode 100644 index ca16b646..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UploadLoraModel.g.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Upload Lora Model - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadLoraModelAsync( - - global::DeepInfra.LoraModelUploadIn request, - string? xiApiKey = default, - global::System.Threading.CancellationToken cancellationToken = default); - /// - /// Upload Lora Model - /// - /// - /// - /// - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UploadLoraModelAsync( - string hfModelName, - string loraModelName, - string? xiApiKey = default, - string? hfToken = default, - string? baseModelName = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs deleted file mode 100644 index 493ef7e8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs deleted file mode 100644 index bafb060a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage Api Token - /// - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageApiTokenAsync( - string apiToken, - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs deleted file mode 100644 index 689409e1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage Rent - /// - /// - /// start of period, in seconds since unix epoch - /// - /// - /// end of period, in seconds since unix epoch - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageRentAsync( - int from, - int? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs deleted file mode 100644 index dbeafab3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public partial interface IDeepInfraClient - { - /// - /// Usage Tokens - /// - /// - /// start of period in YYYY.MM, current(-N), unix_timestamp (in seconds, UTC) format - /// - /// - /// end of period (if missing a single month marked by from is return), same format as from - /// - /// - /// The token to cancel the operation with - /// - global::System.Threading.Tasks.Task UsageTokensAsync( - string from, - string? to = default, - object? session = default, - global::System.Threading.CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs index 3b6c9ecc..28009492 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.g.cs @@ -4,6 +4,7 @@ namespace DeepInfra { /// + /// The DeepInfra API provides serverless AI inference, custom model deployments, and GPU rentals.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
@@ -32,6 +33,11 @@ public partial interface IDeepInfraClient : global::System.IDisposable /// ensuring is populated. /// public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// /// @@ -39,5 +45,105 @@ public partial interface IDeepInfraClient : global::System.IDisposable global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + /// + /// User profile, team management, and rate limits. + /// + public AccountClient Account { get; } + + /// + /// Manage agent-framework instances (OpenClaw and friends). + /// + public AgentsClient Agents { get; } + + /// + /// OpenAI-compatible speech synthesis, transcription, and translation. + /// + public AudioClient Audio { get; } + + /// + /// API tokens, SSH keys, scoped JWTs, and login flows. + /// + public AuthenticationClient Authentication { get; } + + /// + /// Payment methods, usage tracking, and billing. + /// + public BillingClient Billing { get; } + + /// + /// OpenAI and Anthropic-compatible chat completion endpoints for LLMs. + /// + public ChatCompletionsClient ChatCompletions { get; } + + /// + /// Deploy and manage private model instances with autoscaling. + /// + public DedicatedModelsClient DedicatedModels { get; } + + /// + /// Generate text embeddings for search and RAG. + /// + public EmbeddingsClient Embeddings { get; } + + /// + /// File uploads and batch processing. + /// + public FilesBatchesClient FilesBatches { get; } + + /// + /// Rent dedicated GPU containers. + /// + public GpuRentalsClient GpuRentals { get; } + + /// + /// Generate, edit, and create variations of images. + /// + public ImageGenerationClient ImageGeneration { get; } + + /// + /// Native DeepInfra inference API for models and deployments. + /// + public InferenceClient Inference { get; } + + /// + /// Create, manage, and query LoRA adapter models. + /// + public LoRAAdaptersClient LoRAAdapters { get; } + + /// + /// Query inference logs, deployment logs, and usage metrics. + /// + public LogsMetricsClient LogsMetrics { get; } + + /// + /// Browse, search, and manage AI models. + /// + public ModelsClient Models { get; } + + /// + /// OpenAI-compatible text completion endpoints. + /// + public TextCompletionsClient TextCompletions { get; } + + /// + /// ElevenLabs-compatible TTS endpoints and voice management. + /// + public TextToSpeechClient TextToSpeech { get; } + + /// + /// + /// + 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..c831d82e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.OpenaiEmbeddings.g.cs @@ -0,0 +1,90 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// 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, + 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..5b039878 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IEmbeddingsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate text embeddings for search and RAG.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IEmbeddingsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.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..e2a9e9a8 --- /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: 100 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListFilesAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Files + /// + /// + /// + /// + /// + /// Default Value: 100 + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListFilesAsResponseAsync( + string? after = default, + string? purpose = default, + string? order = default, + int? limit = default, + string? xiApiKey = default, + 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..cc57a888 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IFilesBatchesClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// File uploads and batch processing.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IFilesBatchesClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsDelete.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.ContainerRentalsDelete.g.cs new file mode 100644 index 00000000..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..a1959120 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IGpuRentalsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Rent dedicated GPU containers.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IGpuRentalsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesEdits.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.OpenaiImagesEdits.g.cs new file mode 100644 index 00000000..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..32f31f95 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IImageGenerationClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate, edit, and create variations of images.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IImageGenerationClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.InferenceDeploy.g.cs new file mode 100644 index 00000000..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..eff112b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IInferenceClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Native DeepInfra inference API for models and deployments.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IInferenceClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.CreateLora.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.CreateLora.g.cs new file mode 100644 index 00000000..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..a5583433 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILoRAAdaptersClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Create, manage, and query LoRA adapter models.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ILoRAAdaptersClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.DeploymentLogsQuery.g.cs new file mode 100644 index 00000000..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..88e2a74f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ILogsMetricsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Query inference logs, deployment logs, and usage metrics.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ILogsMetricsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.GetHardware.g.cs new file mode 100644 index 00000000..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..d9c2aa54 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.ModelMetaUpdate.g.cs @@ -0,0 +1,87 @@ +#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) + /// + /// + /// 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, + 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..a6126fa9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IModelsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Browse, search, and manage AI models.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IModelsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs new file mode 100644 index 00000000..64a2e665 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.OpenaiCompletions.g.cs @@ -0,0 +1,165 @@ +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// input prompt - a single string is currently supported + /// + /// + /// The maximum number of tokens to generate in the completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// return top tokens and their log-probabilities + /// + /// + /// return prompt as part of the respons + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// streaming options + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// return tokens as token ids + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task OpenaiCompletionsAsync( + string model, + global::DeepInfra.AnyOf> prompt, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + int? maxTokens = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? n = default, + bool? stream = default, + int? logprobs = default, + bool? echo = default, + global::DeepInfra.AnyOf, object>? stop = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + bool? returnTokensAsTokenIds = default, + string? promptCacheKey = default, + global::DeepInfra.CompletionMultiModalData? data = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.g.cs new file mode 100644 index 00000000..9bef335f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextCompletionsClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible text completion endpoints.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ITextCompletionsClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.CreateVoice.g.cs new file mode 100644 index 00000000..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..a9b2435f --- /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..95e549c2 --- /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..11d30f6f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ITextToSpeechClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ElevenLabs-compatible TTS endpoints and voice management.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ITextToSpeechClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.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..e5118e20 --- /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..ceba85b5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IUtilitiesClient.g.cs @@ -0,0 +1,49 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Feedback submission and CLI version.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IUtilitiesClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration.g.cs new file mode 100644 index 00000000..c5967065 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration.g.cs @@ -0,0 +1,69 @@ +#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 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-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, + global::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..0dff6654 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.IVideosClient.CreateVideoGeneration2.g.cs @@ -0,0 +1,69 @@ +#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 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-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, + global::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..2adc34c6 --- /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..0b3b1686 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesEdits.g.cs @@ -0,0 +1,1622 @@ + +#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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesEditsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesEditsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty), + name: "\"prompt\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesEditsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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..d42bc54a --- /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..84d28f1a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.OpenaiImagesVariations.g.cs @@ -0,0 +1,1601 @@ + +#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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty()); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + var __contentImage = new global::System.Net.Http.StreamContent(image); + __contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + request.Imagename is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentImage, + name: "\"image\"", + fileName: request.Imagename != null ? $"\"{request.Imagename}\"" : string.Empty); + if (__contentImage.Headers.ContentDisposition != null) + { + __contentImage.Headers.ContentDisposition.FileNameStar = null; + } + + if (request.Inp != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Inp.ToString() ?? string.Empty), + name: "\"inp\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty), + name: "\"model\""); + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenaiImagesVariationsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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..64ed9da5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ImageGenerationClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Generate, edit, and create variations of images.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ImageGenerationClient : global::DeepInfra.IImageGenerationClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ImageGenerationClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ImageGenerationClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ImageGenerationClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ImageGenerationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ImageGenerationClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ImageGenerationClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceDeploy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.InferenceDeploy.g.cs new file mode 100644 index 00000000..771d73ea --- /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..71e657ae --- /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..d5fb864a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.InferenceClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Native DeepInfra inference API for models and deployments.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class InferenceClient : global::DeepInfra.IInferenceClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the InferenceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public InferenceClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the InferenceClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public InferenceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the InferenceClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public InferenceClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceState.g.cs new file mode 100644 index 00000000..851d468b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class AgentInstanceStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.AgentInstanceState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::DeepInfra.AgentInstanceStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.AgentInstanceState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.AgentInstanceState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AgentInstanceState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.AgentInstanceStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceStateNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceStateNullable.g.cs new file mode 100644 index 00000000..1ddc50b6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AgentInstanceStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class AgentInstanceStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.AgentInstanceState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::DeepInfra.AgentInstanceStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.AgentInstanceState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.AgentInstanceState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AgentInstanceState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::DeepInfra.AgentInstanceStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs index eecc50b1..081bae0a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf2.g.cs @@ -107,7 +107,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serialization catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs index 96f1cf5e..554e0bca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf3.g.cs @@ -137,7 +137,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serializa catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null) + { try { @@ -151,7 +154,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Serializa catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs index 30633aa6..f4c4636e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf4.g.cs @@ -167,7 +167,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Seria catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -181,7 +184,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Seria catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { @@ -195,7 +201,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.Seria catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs index d1167b4b..eefa6abf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf5.g.cs @@ -197,7 +197,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { @@ -211,7 +214,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { @@ -225,7 +231,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { @@ -239,7 +248,10 @@ public class AnyOfJsonConverter : global::System.Text.Json.S catch (global::System.InvalidOperationException) { } + } + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null) + { try { diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf8.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf8.g.cs deleted file mode 100644 index 91d0be5f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf8.g.cs +++ /dev/null @@ -1,470 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> - { - /// - public override global::DeepInfra.AnyOf Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - - using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); - var __rawJson = __jsonDocument.RootElement.GetRawText(); - var __jsonProps = new global::System.Collections.Generic.HashSet(); - if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) - { - foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) - { - __jsonProps.Add(__jsonProp.Name); - } - } - - var __score0 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score0++; - } - } - } - var __score1 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score1++; - } - } - } - var __score2 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score2++; - } - } - } - var __score3 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score3++; - } - } - } - var __score4 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T5), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score4++; - } - } - } - var __score5 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T6), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score5++; - } - } - } - var __score6 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T7), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score6++; - } - } - } - var __score7 = 0; - { - var __ti = typeInfoResolver.GetTypeInfo(typeof(T8), options); - if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) - { - foreach (var __prop in __ti.Properties) - { - if (__jsonProps.Contains(__prop.Name)) __score7++; - } - } - } - var __bestScore = 0; - var __bestIndex = -1; - if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } - if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } - if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } - if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } - if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } - if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; } - if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; } - if (__score7 > __bestScore) { __bestScore = __score7; __bestIndex = 7; } - - T1? value1 = default; - T2? value2 = default; - T3? value3 = default; - T4? value4 = default; - T5? value5 = default; - T6? value6 = default; - T7? value7 = default; - T8? value8 = default; - if (__bestIndex >= 0) - { - if (__bestIndex == 0) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 1) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 2) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 3) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 4) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); - value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 5) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); - value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 6) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); - value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - else if (__bestIndex == 7) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); - value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - } - - if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null) - { - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); - value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); - value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); - value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - - try - { - - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); - value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); - } - catch (global::System.Text.Json.JsonException) - { - } - catch (global::System.InvalidOperationException) - { - } - } - - var __value = new global::DeepInfra.AnyOf( - value1, - - value2, - - value3, - - value4, - - value5, - - value6, - - value7, - - value8 - ); - - return __value; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.AnyOf value, - global::System.Text.Json.JsonSerializerOptions options) - { - options = options ?? throw new global::System.ArgumentNullException(nameof(options)); - var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); - - if (value.IsValue1) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); - } - else if (value.IsValue2) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); - } - else if (value.IsValue3) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); - } - else if (value.IsValue4) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4!, typeInfo); - } - else if (value.IsValue5) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5!, typeInfo); - } - else if (value.IsValue6) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value6!, typeInfo); - } - else if (value.IsValue7) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value7!, typeInfo); - } - else if (value.IsValue8) - { - var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? - throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value8!, typeInfo); - } - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf9.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf9.g.cs new file mode 100644 index 00000000..b862eaa4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.AnyOf9.g.cs @@ -0,0 +1,546 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public class AnyOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::DeepInfra.AnyOf Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __score2 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T3), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score2++; + } + } + } + var __score3 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T4), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score3++; + } + } + } + var __score4 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T5), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score4++; + } + } + } + var __score5 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T6), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score5++; + } + } + } + var __score6 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T7), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score6++; + } + } + } + var __score7 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T8), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score7++; + } + } + } + var __score8 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T9), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score8++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; } + if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; } + if (__score4 > __bestScore) { __bestScore = __score4; __bestIndex = 4; } + if (__score5 > __bestScore) { __bestScore = __score5; __bestIndex = 5; } + if (__score6 > __bestScore) { __bestScore = __score6; __bestIndex = 6; } + if (__score7 > __bestScore) { __bestScore = __score7; __bestIndex = 7; } + if (__score8 > __bestScore) { __bestScore = __score8; __bestIndex = 8; } + + T1? value1 = default; + T2? value2 = default; + T3? value3 = default; + T4? value4 = default; + T5? value5 = default; + T6? value6 = default; + T7? value7 = default; + T8? value8 = default; + T9? value9 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 2) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 3) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 4) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 5) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); + value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 6) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); + value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 7) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); + value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 8) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T9).Name}"); + value9 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + value3 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + value4 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + value5 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); + value6 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); + value7 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); + value8 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null && value3 == null && value4 == null && value5 == null && value6 == null && value7 == null && value8 == null && value9 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T9).Name}"); + value9 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::DeepInfra.AnyOf( + value1, + + value2, + + value3, + + value4, + + value5, + + value6, + + value7, + + value8, + + value9 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.AnyOf value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); + } + else if (value.IsValue3) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T3).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3!, typeInfo); + } + else if (value.IsValue4) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T4).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4!, typeInfo); + } + else if (value.IsValue5) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T5).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5!, typeInfo); + } + else if (value.IsValue6) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T6).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value6!, typeInfo); + } + else if (value.IsValue7) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T7).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value7!, typeInfo); + } + else if (value.IsValue8) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T8).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value8!, typeInfo); + } + else if (value.IsValue9) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T9).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value9!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs deleted file mode 100644 index 3bd3c2b9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Nullable.g.cs deleted file mode 100644 index 9add7282..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs deleted file mode 100644 index 48466e4d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToValueString(value)); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs deleted file mode 100644 index a0d6fb8c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs deleted file mode 100644 index d3e92f0f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs +++ /dev/null @@ -1,53 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2JsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToEnum(stringValue) ?? default; - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToValueString(value)); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Nullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Nullable.g.cs deleted file mode 100644 index 52613df3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Nullable.g.cs +++ /dev/null @@ -1,60 +0,0 @@ -#nullable enable - -namespace DeepInfra.JsonConverters -{ - /// - public sealed class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter - { - /// - public override global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? Read( - ref global::System.Text.Json.Utf8JsonReader reader, - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case global::System.Text.Json.JsonTokenType.String: - { - var stringValue = reader.GetString(); - if (stringValue != null) - { - return global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToEnum(stringValue); - } - - break; - } - case global::System.Text.Json.JsonTokenType.Number: - { - var numValue = reader.GetInt32(); - return (global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2)numValue; - } - case global::System.Text.Json.JsonTokenType.Null: - { - return default(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2?); - } - default: - throw new global::System.ArgumentOutOfRangeException(nameof(reader)); - } - - return default; - } - - /// - public override void Write( - global::System.Text.Json.Utf8JsonWriter writer, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? value, - global::System.Text.Json.JsonSerializerOptions options) - { - writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); - - if (value == null) - { - writer.WriteNullValue(); - } - else - { - writer.WriteStringValue(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions.ToValueString(value.Value)); - } - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.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.OpenAIEmbeddingsInInputType2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenAIEmbeddingsInInputType2.g.cs new file mode 100644 index 00000000..b1b16081 --- /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..feb7b56f --- /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..228b8759 --- /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..47de1ed3 --- /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..4937e366 --- /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..1c753848 --- /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.OpenclawListV1AgentsGetState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetState.g.cs new file mode 100644 index 00000000..6e0f75b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetState.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenclawListV1AgentsGetStateJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenclawListV1AgentsGetState Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenclawListV1AgentsGetState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenclawListV1AgentsGetState); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenclawListV1AgentsGetState value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullable.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullable.g.cs new file mode 100644 index 00000000..5f66c6ef --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.OpenclawListV1AgentsGetStateNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace DeepInfra.JsonConverters +{ + /// + public sealed class OpenclawListV1AgentsGetStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::DeepInfra.OpenclawListV1AgentsGetState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::DeepInfra.OpenclawListV1AgentsGetState)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::DeepInfra.OpenclawListV1AgentsGetState?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::DeepInfra.OpenclawListV1AgentsGetState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::DeepInfra.OpenclawListV1AgentsGetStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.StandardArgsKvCacheDtype2.g.cs new file mode 100644 index 00000000..fb07a524 --- /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..7da3a441 --- /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..2f8064f6 --- /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..d6bb62c9 --- /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.JsonSerializerContext.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs index 3fd9bb26..45b011ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContext.g.cs @@ -17,6 +17,10 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.SuspendReasonNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.AgentInstanceStateJsonConverter), + + typeof(global::DeepInfra.JsonConverters.AgentInstanceStateNullableJsonConverter), + typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2JsonConverter), typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2NullableJsonConverter), @@ -25,22 +29,10 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2JsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2NullableJsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemJsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemNullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2JsonConverter), typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2NullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2JsonConverter), - - typeof(global::DeepInfra.JsonConverters.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2NullableJsonConverter), - typeof(global::DeepInfra.JsonConverters.ChatReasoningSettingsEffort2JsonConverter), typeof(global::DeepInfra.JsonConverters.ChatReasoningSettingsEffort2NullableJsonConverter), @@ -89,10 +81,22 @@ namespace DeepInfra 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), @@ -113,6 +117,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 +133,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,15 +151,15 @@ namespace DeepInfra typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), - typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), + typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter), @@ -157,21 +175,26 @@ 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::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.ConfigIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ConfigOut))] @@ -181,7 +204,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,6 +223,7 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AgentInstanceState), TypeInfoPropertyName = "AgentInstanceState2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnthropicMessagesIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringIListAnthropicSystemContentObject2")] @@ -208,6 +238,14 @@ namespace DeepInfra [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[]))] @@ -215,22 +253,13 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item), TypeInfoPropertyName = "BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item), TypeInfoPropertyName = "BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiFilesV1FilesPost))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesEditsIn))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIImagesVariationsIn))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionAssistantMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringIListChatCompletionContentPartTextObject2")] @@ -242,14 +271,16 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.InputAudio))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionContentPartImage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ImageURL))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionContentPartVideo))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.VideoURL))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.Function))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionSystemMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>), TypeInfoPropertyName = "AnyOfStringIListChatCompletionContentPartText2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionToolMessage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatCompletionUserMessage))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>), TypeInfoPropertyName = "AnyOfStringIListAnyOfChatCompletionContentPartTextChatCompletionContentPartImageChatCompletionContentPartAudio2")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfChatCompletionContentPartTextChatCompletionContentPartImageChatCompletionContentPartAudio2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>), TypeInfoPropertyName = "ChatCompletionContentPartVideo_ba71f0f0ed6c3c8a")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>), TypeInfoPropertyName = "ChatCompletionContentPartVideo_42446b6a8b5bc71f")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "ChatCompletionContentPartVideo_564b9ad0201a3c82")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatReasoningSettings))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatReasoningSettingsEffort2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ChatTools))] @@ -273,6 +304,7 @@ 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")] @@ -280,7 +312,8 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployStatusOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeployType), TypeInfoPropertyName = "DeployType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentLogQueryOut))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary>>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentMainStatsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.DeploymentStatsOut))] @@ -288,6 +321,9 @@ namespace DeepInfra [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")] @@ -328,7 +364,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,20 +373,24 @@ 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::DeepInfra.ServiceTier))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf), TypeInfoPropertyName = "AnyOfChatCompletionToolMessageChatCompletionAssistantMessageChatCompletionUserMessageChatCompletionSystemMessage2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringIListStringObject2")] @@ -363,11 +403,18 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAICompletionsIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>), TypeInfoPropertyName = "AnyOfStringIListInt322")] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIEmbeddingsIn))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.ServiceTier))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf, string>), TypeInfoPropertyName = "AnyOfIListStringString2")] + [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))] [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.OpenAIImagesGenerationsIn))] @@ -377,13 +424,23 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAIModelsOut))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenAITextToSpeechIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawAgentTypeMetaOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawPlanOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawBackupOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawCreateIn))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawCreateOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawInstanceOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawLaunchTokenOut))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenClawUpdateIn))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterDatacenter))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterModelData))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.OpenRouterPricing))] - [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.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.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))] @@ -400,9 +457,17 @@ 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))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.StandardArgsQuantization2))] + [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.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))] @@ -410,7 +475,14 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf>>?), TypeInfoPropertyName = "ChatCompletionContentPartVideo_da2c47f6e81dd0c4")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf?), TypeInfoPropertyName = "ChatCompletionContentPartVideo_06f031293c314952")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf?), TypeInfoPropertyName = "ModelPricingFrameUnits_6ea86b27c5e04f0a")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::DeepInfra.AnyOf?), TypeInfoPropertyName = "ModelPricingFrameUnits_ed89053ab1900c9d")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] @@ -419,17 +491,19 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [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))] @@ -441,14 +515,18 @@ namespace DeepInfra [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::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))] @@ -456,6 +534,8 @@ namespace DeepInfra [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs index 5a8cdcaf..80089433 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs @@ -36,7 +36,7 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.BillingPortalOut? Type2 { get; set; } + public global::DeepInfra.AddFundsOut? Type2 { get; set; } /// /// /// @@ -44,791 +44,791 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.Checklist? Type4 { get; set; } + public object? Type4 { get; set; } /// /// /// - public bool? Type5 { get; set; } + public global::DeepInfra.BillingAddressOut? Type5 { get; set; } /// /// /// - public double? Type6 { get; set; } + public global::DeepInfra.BillingPortalOut? Type6 { get; set; } /// /// /// - public object? Type7 { get; set; } + public global::DeepInfra.Checklist? Type7 { get; set; } /// /// /// - public global::DeepInfra.SuspendReason? Type8 { get; set; } + public bool? Type8 { get; set; } /// /// /// - public global::DeepInfra.ConfigIn? Type9 { get; set; } + public global::DeepInfra.PaymentMethodOut? Type9 { get; set; } /// /// /// - public global::DeepInfra.ConfigOut? Type10 { get; set; } + public double? Type10 { get; set; } /// /// /// - public global::DeepInfra.DeepStartApplicationIn? Type11 { get; set; } + public global::DeepInfra.SuspendReason? Type11 { get; set; } /// /// /// - public global::DeepInfra.DeepStartApplicationOut? Type12 { get; set; } + public global::DeepInfra.ConfigIn? Type12 { get; set; } /// /// /// - public global::DeepInfra.DiscountMeta? Type13 { get; set; } + public global::DeepInfra.ConfigOut? Type13 { get; set; } /// /// /// - public global::DeepInfra.HTTPValidationError? Type14 { get; set; } + public global::DeepInfra.DeepStartApplicationIn? Type14 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type15 { get; set; } + public global::DeepInfra.DeepStartApplicationOut? Type15 { get; set; } /// /// /// - public global::DeepInfra.ValidationError? Type16 { get; set; } + public global::DeepInfra.DiscountMeta? Type16 { get; set; } /// /// /// - public global::DeepInfra.ModelMeta? Type17 { get; set; } + public global::DeepInfra.HTTPValidationError? Type17 { get; set; } /// /// /// - public global::DeepInfra.TimeInterval? Type18 { get; set; } + public global::System.Collections.Generic.IList? Type18 { get; set; } /// /// /// - public long? Type19 { get; set; } + public global::DeepInfra.ValidationError? Type19 { get; set; } /// /// /// - public global::DeepInfra.TopUpIn? Type20 { get; set; } + public global::DeepInfra.InvoiceListItem? Type20 { get; set; } /// /// /// - public global::DeepInfra.UsageItem? Type21 { get; set; } + public global::DeepInfra.InvoicesOut? Type21 { get; set; } /// /// /// - public global::DeepInfra.UsageMonth? Type22 { get; set; } + public global::System.Collections.Generic.IList? Type22 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type23 { get; set; } + public global::DeepInfra.ModelMeta? Type23 { get; set; } /// /// /// - public global::DeepInfra.UsageOut? Type24 { get; set; } + public global::DeepInfra.PaymentMethodBank? Type24 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type25 { get; set; } + public global::DeepInfra.PaymentMethodCard? Type25 { get; set; } /// /// /// - public global::DeepInfra.UsageRentOut? Type26 { get; set; } + public global::DeepInfra.PaymentMethodCashApp? Type26 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type27 { get; set; } + public global::DeepInfra.TimeInterval? Type27 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type28 { get; set; } + public long? Type28 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type29 { get; set; } + public global::DeepInfra.TopUpIn? Type29 { get; set; } /// /// /// - public global::DeepInfra.AnthropicMessagesIn? Type30 { get; set; } + public global::DeepInfra.UsageItem? Type30 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type31 { get; set; } + public global::DeepInfra.UsageMonth? Type31 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? Type32 { get; set; } + public global::System.Collections.Generic.IList? Type32 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type33 { get; set; } + public global::DeepInfra.UsageOut? Type33 { get; set; } /// /// /// - public global::DeepInfra.AnthropicSystemContent? Type34 { get; set; } + public global::System.Collections.Generic.IList? Type34 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type35 { get; set; } + public global::DeepInfra.UsageRentOut? Type35 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type36 { get; set; } + public global::System.Collections.Generic.Dictionary? Type36 { get; set; } /// /// /// - public global::DeepInfra.AnthropicTool? Type37 { get; set; } + public global::System.Collections.Generic.IList>? Type37 { get; set; } /// /// /// - public global::DeepInfra.AnthropicThinkingConfig? Type38 { get; set; } + public global::DeepInfra.AnyOf? Type38 { get; set; } /// /// /// - public global::DeepInfra.AnthropicTokenCountRequest? Type39 { get; set; } + public global::DeepInfra.AgentInstanceState? Type39 { get; set; } /// /// /// - public global::DeepInfra.ApiToken? Type40 { get; set; } + public global::DeepInfra.AnthropicMessagesIn? Type40 { get; set; } /// /// /// - public global::System.DateTimeOffset? Type41 { get; set; } + public global::System.Collections.Generic.IList? Type41 { get; set; } /// /// /// - public global::DeepInfra.ApiTokenIn? Type42 { get; set; } + public global::DeepInfra.AnyOf, object>? Type42 { get; set; } /// /// /// - public global::DeepInfra.ApiTokenVercelExportIn? Type43 { get; set; } + public global::System.Collections.Generic.IList? Type43 { get; set; } /// /// /// - public global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? Type44 { get; set; } + public global::DeepInfra.AnthropicSystemContent? Type44 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type45 { get; set; } + public global::System.Collections.Generic.IList? Type45 { get; set; } /// /// /// - public byte[]? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? Type47 { get; set; } + public global::DeepInfra.AnthropicTool? Type47 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? Type48 { get; set; } + public global::DeepInfra.AnthropicThinkingConfig? Type48 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type49 { get; set; } + public global::DeepInfra.AnthropicTokenCountRequest? Type49 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type50 { get; set; } + public global::DeepInfra.ApiToken? Type50 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? Type51 { get; set; } + public global::System.DateTimeOffset? Type51 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? Type52 { get; set; } + public global::DeepInfra.ApiTokenIn? Type52 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type53 { get; set; } + public global::DeepInfra.ApiTokenVercelExportIn? Type53 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type54 { get; set; } + public global::DeepInfra.BatchErrorData? Type54 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? Type55 { get; set; } + public global::DeepInfra.BatchErrors? Type55 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? Type56 { get; set; } + public global::System.Collections.Generic.IList? Type56 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? Type57 { get; set; } + public global::DeepInfra.BatchInputTokensDetails? Type57 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? Type58 { get; set; } + public global::DeepInfra.BatchOutputExpiresAfter? Type58 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiFilesV1FilesPost? Type59 { get; set; } + public global::DeepInfra.BatchOutputTokensDetails? Type59 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? Type60 { get; set; } + public global::DeepInfra.BatchRequestCounts? Type60 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? Type61 { get; set; } + public global::DeepInfra.BatchUsage? Type61 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesEditsIn? Type62 { get; set; } + public global::DeepInfra.BodyCreateVoiceV1VoicesAddPost? Type62 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? Type63 { get; set; } + public global::System.Collections.Generic.IList? Type63 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? Type64 { get; set; } + public byte[]? Type64 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesVariationsIn? Type65 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost? Type65 { get; set; } /// /// /// - public global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? Type66 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat2? Type66 { get; set; } /// /// /// - public global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? Type67 { get; set; } + public global::System.Collections.Generic.IList? Type67 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionAssistantMessage? Type68 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularitiesVariant1Item? Type68 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? Type69 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPost? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat2? Type70 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionContentPartText? Type71 { get; set; } + public global::DeepInfra.BodyOpenaiFilesV1FilesPost? Type71 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type72 { get; set; } + public global::DeepInfra.BodyOpenaiImagesEditsV1ImagesEditsPost? Type72 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionMessageToolCall? Type73 { get; set; } + public global::DeepInfra.OpenAIImagesEditsIn? Type73 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionContentPartAudio? Type74 { get; set; } + public global::DeepInfra.BodyOpenaiImagesVariationsV1ImagesVariationsPost? Type74 { get; set; } /// /// /// - public global::DeepInfra.InputAudio? Type75 { get; set; } + public global::DeepInfra.OpenAIImagesVariationsIn? Type75 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionContentPartImage? Type76 { get; set; } + public global::DeepInfra.BodyUpdateVoiceV1VoicesVoiceIdEditPost? Type76 { get; set; } /// /// /// - public global::DeepInfra.ImageURL? Type77 { get; set; } + public global::DeepInfra.ChatCompletionAssistantMessage? Type77 { get; set; } /// /// /// - public global::DeepInfra.Function? Type78 { get; set; } + public global::DeepInfra.AnyOf, object>? Type78 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionSystemMessage? Type79 { get; set; } + public global::System.Collections.Generic.IList? Type79 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>? Type80 { get; set; } + public global::DeepInfra.ChatCompletionContentPartText? Type80 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionToolMessage? Type81 { get; set; } + public global::System.Collections.Generic.IList? Type81 { get; set; } /// /// /// - public global::DeepInfra.ChatCompletionUserMessage? Type82 { get; set; } + public global::DeepInfra.ChatCompletionMessageToolCall? Type82 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>>? Type83 { get; set; } + public global::DeepInfra.ChatCompletionContentPartAudio? Type83 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type84 { get; set; } + public global::DeepInfra.InputAudio? Type84 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type85 { get; set; } + public global::DeepInfra.ChatCompletionContentPartImage? Type85 { get; set; } /// /// /// - public global::DeepInfra.ChatReasoningSettings? Type86 { get; set; } + public global::DeepInfra.ImageURL? Type86 { get; set; } /// /// /// - public global::DeepInfra.ChatReasoningSettingsEffort2? Type87 { get; set; } + public global::DeepInfra.ChatCompletionContentPartVideo? Type87 { get; set; } /// /// /// - public global::DeepInfra.ChatTools? Type88 { get; set; } + public global::DeepInfra.VideoURL? Type88 { get; set; } /// /// /// - public global::DeepInfra.FunctionDefinition? Type89 { get; set; } + public global::DeepInfra.Function? Type89 { get; set; } /// /// /// - public global::DeepInfra.CompletionMultiModalData? Type90 { get; set; } + public global::DeepInfra.ChatCompletionSystemMessage? Type90 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalOut? Type91 { get; set; } + public global::DeepInfra.AnyOf>? Type91 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalStateOut? Type92 { get; set; } + public global::DeepInfra.ChatCompletionToolMessage? Type92 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalStartIn? Type93 { get; set; } + public global::DeepInfra.ChatCompletionUserMessage? Type93 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalStartOut? Type94 { get; set; } + public global::DeepInfra.ChatReasoningSettings? Type94 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalUpdateIn? Type95 { get; set; } + public global::DeepInfra.ChatReasoningSettingsEffort2? Type95 { get; set; } /// /// /// - public global::DeepInfra.CreateLoraApiRequest? Type96 { get; set; } + public global::DeepInfra.ChatTools? Type96 { get; set; } /// /// /// - public global::DeepInfra.SourceModel? Type97 { get; set; } + public global::DeepInfra.FunctionDefinition? Type97 { get; set; } /// /// /// - public global::DeepInfra.DeepError? Type98 { get; set; } + public global::DeepInfra.CompletionMultiModalData? Type98 { get; set; } /// /// /// - public global::DeepInfra.DeployDelete? Type99 { get; set; } + public global::DeepInfra.ContainerRentalOut? Type99 { get; set; } /// /// /// - public global::DeepInfra.DeployGPUAvailability? Type100 { get; set; } + public global::DeepInfra.ContainerRentalStateOut? Type100 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type101 { get; set; } + public global::DeepInfra.ContainerRentalStartIn? Type101 { get; set; } /// /// /// - public global::DeepInfra.GPUAvailabilityInfo? Type102 { get; set; } + public global::DeepInfra.ContainerRentalStartOut? Type102 { get; set; } /// /// /// - public global::DeepInfra.DeployGPUs? Type103 { get; set; } + public global::DeepInfra.ContainerRentalUpdateIn? Type103 { get; set; } /// /// /// - public global::DeepInfra.DeployInstances? Type104 { get; set; } + public global::DeepInfra.CreateLoraApiRequest? Type104 { get; set; } /// /// /// - public global::DeepInfra.DeployLLMConfig? Type105 { get; set; } + public global::DeepInfra.SourceModel? Type105 { get; set; } /// /// /// - public global::DeepInfra.HFWeights? Type106 { get; set; } + public global::DeepInfra.DeepError? Type106 { get; set; } /// /// /// - public global::DeepInfra.DeployLLMIn? Type107 { get; set; } + public global::DeepInfra.DeployDelete? Type107 { get; set; } /// /// /// - public global::DeepInfra.ScaleSettings? Type108 { get; set; } + public global::DeepInfra.DeployGPUAvailability? Type108 { get; set; } /// /// /// - public global::DeepInfra.DeployLLMUpdateIn? Type109 { get; set; } + public global::System.Collections.Generic.IList? Type109 { get; set; } /// /// /// - public global::DeepInfra.DeployModelIn? Type110 { get; set; } + public global::DeepInfra.GPUAvailabilityInfo? Type110 { get; set; } /// /// /// - public global::DeepInfra.ModelProvider? Type111 { get; set; } + public global::DeepInfra.DeployGPUs? Type111 { get; set; } /// /// /// - public global::DeepInfra.DeployResult? Type112 { get; set; } + public global::DeepInfra.DeployInstances? Type112 { get; set; } /// /// /// - public global::DeepInfra.DeployStatusOut? Type113 { get; set; } + public global::DeepInfra.DeployLLMConfig? Type113 { get; set; } /// /// /// - public global::DeepInfra.DeployType? Type114 { get; set; } + public global::DeepInfra.HFWeights? Type114 { get; set; } /// /// /// - public global::DeepInfra.DeploymentLogQueryOut? Type115 { get; set; } + public global::DeepInfra.DeployLLMIn? Type115 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type116 { get; set; } + public global::DeepInfra.ScaleSettings? Type116 { get; set; } /// /// /// - public global::DeepInfra.DeploymentMainStatsOut? Type117 { get; set; } + public global::DeepInfra.StandardArgs? Type117 { get; set; } /// /// /// - public global::DeepInfra.DeploymentOut? Type118 { get; set; } + public global::DeepInfra.DeployLLMUpdateIn? Type118 { get; set; } /// /// /// - public global::DeepInfra.DeploymentStatsOut? Type119 { get; set; } + public global::DeepInfra.DeployModelIn? Type119 { get; set; } /// /// /// - public global::DeepInfra.DetailedDeploymentStatsOut? Type120 { get; set; } + public global::DeepInfra.ModelProvider? Type120 { get; set; } /// /// /// - public global::DeepInfra.LLMDeploymentStatsOut? Type121 { get; set; } + public global::DeepInfra.DeployResult? Type121 { get; set; } /// /// /// - public global::DeepInfra.EmbeddingsDeploymentStatsOut? Type122 { get; set; } + public global::DeepInfra.DeployStatusOut? Type122 { get; set; } /// /// /// - public global::DeepInfra.TimeDeploymentStatsOut? Type123 { get; set; } + public global::DeepInfra.DeployType? Type123 { get; set; } /// /// /// - public global::DeepInfra.DisplayNameIn? Type124 { get; set; } + public global::DeepInfra.DeploymentLogQueryOut? Type124 { get; set; } /// /// /// - public global::DeepInfra.ElevenLabsTextToSpeechIn? Type125 { get; set; } + public global::System.Collections.Generic.Dictionary>>? Type125 { get; set; } /// /// /// - public global::DeepInfra.TtsResponseFormat? Type126 { get; set; } + public global::System.Collections.Generic.IList>? Type126 { get; set; } /// /// /// - public global::DeepInfra.EmailsOut? Type127 { get; set; } + public global::DeepInfra.DeploymentMainStatsOut? Type127 { get; set; } /// /// /// - public global::DeepInfra.FAQEntryOut? Type128 { get; set; } + public global::DeepInfra.DeploymentOut? Type128 { get; set; } /// /// /// - public global::DeepInfra.FeedbackIn? Type129 { get; set; } + public global::DeepInfra.DeploymentStatsOut? Type129 { get; set; } /// /// /// - public global::DeepInfra.GetVoicesOut? Type130 { get; set; } + public global::DeepInfra.DetailedDeploymentStatsOut? Type130 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type131 { get; set; } + public global::DeepInfra.LLMDeploymentStatsOut? Type131 { get; set; } /// /// /// - public global::DeepInfra.Voice? Type132 { get; set; } + public global::DeepInfra.EmbeddingsDeploymentStatsOut? Type132 { get; set; } /// /// /// - public global::DeepInfra.GpuLimitOut? Type133 { get; set; } + public global::DeepInfra.TimeDeploymentStatsOut? Type133 { get; set; } /// /// /// - public global::DeepInfra.GpuLimitRequestIn? Type134 { get; set; } + public global::DeepInfra.DetokenizeIn? Type134 { get; set; } /// /// /// - public global::DeepInfra.HFModel? Type135 { get; set; } + public global::System.Collections.Generic.IList? Type135 { get; set; } /// /// /// - public global::DeepInfra.HFTasksE? Type136 { get; set; } + public global::DeepInfra.DetokenizeOut? Type136 { get; set; } /// /// /// - public global::DeepInfra.HardwareOption? Type137 { get; set; } + public global::DeepInfra.DisplayNameIn? Type137 { get; set; } /// /// /// - public global::DeepInfra.HardwareOptionType? Type138 { get; set; } + public global::DeepInfra.ElevenLabsTextToSpeechIn? Type138 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type139 { get; set; } + public global::DeepInfra.TtsResponseFormat? Type139 { get; set; } /// /// /// - public global::DeepInfra.HardwarePricingServerless? Type140 { get; set; } + public global::DeepInfra.EmailsOut? Type140 { get; set; } /// /// /// - public global::DeepInfra.HardwarePricingDedicated? Type141 { get; set; } + public global::DeepInfra.FAQEntryOut? Type141 { get; set; } /// /// /// - public global::DeepInfra.HardwareResponse? Type142 { get; set; } + public global::DeepInfra.FeedbackIn? Type142 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type143 { get; set; } + public global::DeepInfra.GetVoicesOut? Type143 { get; set; } /// /// /// - public global::DeepInfra.ImageURLDetail? Type144 { get; set; } + public global::System.Collections.Generic.IList? Type144 { get; set; } /// /// /// - public global::DeepInfra.InputAudioFormat? Type145 { get; set; } + public global::DeepInfra.Voice? Type145 { get; set; } /// /// /// - public global::DeepInfra.InspectScopedJWTOut? Type146 { get; set; } + public global::DeepInfra.GpuLimitOut? Type146 { get; set; } /// /// /// - public global::DeepInfra.JsonObjectResponseFormat? Type147 { get; set; } + public global::DeepInfra.GpuLimitRequestIn? Type147 { get; set; } /// /// /// - public global::DeepInfra.JsonSchema? Type148 { get; set; } + public global::DeepInfra.HFModel? Type148 { get; set; } /// /// /// - public global::DeepInfra.JsonSchemaResponseFormat? Type149 { get; set; } + public global::DeepInfra.HFTasksE? Type149 { get; set; } /// /// /// - public global::DeepInfra.LogQueryOut? Type150 { get; set; } + public global::DeepInfra.HardwareOption? Type150 { get; set; } /// /// /// - public global::DeepInfra.LoraModelUploadIn? Type151 { get; set; } + public global::DeepInfra.HardwareOptionType? Type151 { get; set; } /// /// /// - public global::DeepInfra.Me? Type152 { get; set; } + public global::DeepInfra.AnyOf? Type152 { get; set; } /// /// /// - public global::DeepInfra.MeVercelConnection2? Type153 { get; set; } + public global::DeepInfra.HardwarePricingServerless? Type153 { get; set; } /// /// /// - public global::DeepInfra.MeIn? Type154 { get; set; } + public global::DeepInfra.HardwarePricingDedicated? Type154 { get; set; } /// /// /// - public global::DeepInfra.ModelDocBlock? Type155 { get; set; } + public global::DeepInfra.HardwareResponse? Type155 { get; set; } /// /// /// - public global::DeepInfra.ModelDocBlockKey? Type156 { get; set; } + public global::System.Collections.Generic.IList? Type156 { get; set; } /// /// /// - public global::DeepInfra.ModelFamilyOut? Type157 { get; set; } + public global::DeepInfra.ImageURLDetail? Type157 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type158 { get; set; } + public global::DeepInfra.InputAudioFormat? Type158 { get; set; } /// /// /// - public global::DeepInfra.PricingPageSectionOut? Type159 { get; set; } + public global::DeepInfra.InspectScopedJWTOut? Type159 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type160 { get; set; } + public global::DeepInfra.JsonObjectResponseFormat? Type160 { get; set; } /// /// /// - public global::DeepInfra.ModelFieldInfo? Type161 { get; set; } + public global::DeepInfra.JsonSchema? Type161 { get; set; } /// /// /// - public global::DeepInfra.ModelInfoOut? Type162 { get; set; } + public global::DeepInfra.JsonSchemaResponseFormat? Type162 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type163 { get; set; } + public global::DeepInfra.LogQueryOut? Type163 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type164 { get; set; } + public global::DeepInfra.LoraModelUploadIn? Type164 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingTime? Type165 { get; set; } + public global::DeepInfra.Me? Type165 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingUptime? Type166 { get; set; } + public global::DeepInfra.MeVercelConnection2? Type166 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingTokens? Type167 { get; set; } + public global::DeepInfra.MeIn? Type167 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingInputLength? Type168 { get; set; } + public global::DeepInfra.ModelDocBlock? Type168 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingInputTokens? Type169 { get; set; } + public global::DeepInfra.ModelDocBlockKey? Type169 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingInputCharacterLength? Type170 { get; set; } + public global::DeepInfra.ModelFamilyOut? Type170 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingImageUnits? Type171 { get; set; } + public global::System.Collections.Generic.IList? Type171 { get; set; } /// /// /// - public global::DeepInfra.ModelPricingOutputLength? Type172 { get; set; } + public global::DeepInfra.PricingPageSectionOut? Type172 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type173 { get; set; } + public global::System.Collections.Generic.IList? Type173 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type174 { get; set; } + public global::DeepInfra.ModelFieldInfo? Type174 { get; set; } /// /// /// - public global::DeepInfra.SchemaVariant? Type175 { get; set; } + public global::DeepInfra.ModelInfoOut? Type175 { get; set; } /// /// /// - public global::DeepInfra.ModelMetaIn? Type176 { get; set; } + public global::System.Collections.Generic.IList? Type176 { get; set; } /// /// /// - public global::DeepInfra.ModelMetadata? Type177 { get; set; } + public global::DeepInfra.ModelPricingTime? Type177 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type178 { get; set; } + public global::DeepInfra.ModelPricingUptime? Type178 { get; set; } /// /// /// - public global::DeepInfra.ModelOut? Type179 { get; set; } + public global::DeepInfra.ModelPricingTokens? Type179 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type180 { get; set; } + public global::DeepInfra.ModelPricingInputLength? Type180 { get; set; } /// /// /// - public global::DeepInfra.ModelPublicityIn? Type181 { get; set; } + public global::DeepInfra.ModelPricingInputTokens? Type181 { get; set; } /// /// /// - public global::DeepInfra.ModelVersionOut? Type182 { get; set; } + public global::DeepInfra.ModelPricingInputCharacterLength? Type182 { get; set; } /// /// /// - public global::DeepInfra.OpenAIBatch? Type183 { get; set; } + public global::DeepInfra.ModelPricingImageUnits? Type183 { get; set; } /// /// /// - public global::DeepInfra.OpenAIBatchesIn? Type184 { get; set; } + public global::DeepInfra.ModelPricingOutputLength? Type184 { get; set; } /// /// /// - public global::DeepInfra.OpenAIBatchesInEndpoint? Type185 { get; set; } + public global::DeepInfra.ModelPricingFrameUnits? Type185 { get; set; } /// /// /// - public global::DeepInfra.OpenAIChatCompletionsIn? Type186 { get; set; } + public global::System.Collections.Generic.IList? Type186 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type187 { get; set; } + public global::System.Collections.Generic.IList? Type187 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type188 { get; set; } + public global::DeepInfra.SchemaVariant? Type188 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? Type189 { get; set; } + public global::DeepInfra.ModelMetaIn? Type189 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type190 { get; set; } + public global::DeepInfra.ModelMetadata? Type190 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type191 { get; set; } + public global::System.Collections.Generic.Dictionary? Type191 { get; set; } /// /// /// - public global::DeepInfra.AnyOf? Type192 { get; set; } + public global::DeepInfra.ModelNameSuggestionOut? Type192 { get; set; } /// /// /// - public global::DeepInfra.TextResponseFormat? Type193 { get; set; } + public global::DeepInfra.ModelOut? Type193 { get; set; } /// /// /// - public global::DeepInfra.RegexResponseFormat? Type194 { get; set; } + public global::DeepInfra.ModelPublicityIn? Type194 { get; set; } /// /// /// - public global::DeepInfra.StreamOptions? Type195 { get; set; } + public global::DeepInfra.ModelVersionOut? Type195 { get; set; } /// /// /// - public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? Type196 { get; set; } + public global::DeepInfra.OpenAIBatchesIn? Type196 { get; set; } /// /// /// - public global::DeepInfra.OpenAICompletionsIn? Type197 { get; set; } + public global::DeepInfra.OpenAIBatchesInEndpoint? Type197 { get; set; } /// /// /// - public global::DeepInfra.AnyOf>? Type198 { get; set; } + public global::System.Collections.Generic.Dictionary? Type198 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type199 { get; set; } + public global::DeepInfra.OpenAIBatchesOut? Type199 { get; set; } /// /// /// - public global::DeepInfra.OpenAIEmbeddingsIn? Type200 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsIn? Type200 { get; set; } /// /// /// @@ -836,179 +836,343 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::DeepInfra.AnyOf, string>? Type202 { get; set; } + public global::DeepInfra.AnyOf? Type202 { get; set; } /// /// /// - public global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? Type203 { get; set; } + public global::DeepInfra.AnyOf, object>? Type203 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImageData? Type204 { get; set; } + public global::System.Collections.Generic.IList? Type204 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesResponseFormat? Type205 { get; set; } + public global::DeepInfra.AnyOf? Type205 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesGenerationsIn? Type206 { get; set; } + public global::DeepInfra.AnyOf? Type206 { get; set; } /// /// /// - public global::DeepInfra.OpenAIImagesOut? Type207 { get; set; } + public global::DeepInfra.TextResponseFormat? Type207 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type208 { get; set; } + public global::DeepInfra.RegexResponseFormat? Type208 { get; set; } /// /// /// - public global::DeepInfra.OpenAIModelOut? Type209 { get; set; } + public global::DeepInfra.StreamOptions? Type209 { get; set; } /// /// /// - public global::DeepInfra.OpenAIModelsOut? Type210 { get; set; } + public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? Type210 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type211 { get; set; } + public global::DeepInfra.OpenAICompletionsIn? Type211 { get; set; } /// /// /// - public global::DeepInfra.OpenAITextToSpeechIn? Type212 { get; set; } + public global::DeepInfra.AnyOf>? Type212 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterDatacenter? Type213 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsIn? Type213 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterModelData? Type214 { get; set; } + public global::DeepInfra.AnyOf>>>? Type214 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterPricing? Type215 { get; set; } + public global::System.Collections.Generic.IList>>? Type215 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type216 { get; set; } + public global::DeepInfra.AnyOf>? Type216 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type217 { get; set; } + public global::System.Collections.Generic.IList? Type217 { get; set; } /// /// /// - public global::DeepInfra.OpenRouterModelsOut? Type218 { get; set; } + public global::DeepInfra.InputVariant2ItemVariant2Item? Type218 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type219 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminator? Type219 { get; set; } /// /// /// - public global::DeepInfra.PricingPageEntryOut? Type220 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInInputVariant2ItemVariant2ItemDiscriminatorType? Type220 { get; set; } /// /// /// - public global::DeepInfra.PricingType? Type221 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInInputType2? Type221 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type222 { get; set; } + public global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? Type222 { get; set; } /// /// /// - public global::DeepInfra.RateLimitOut? Type223 { get; set; } + public global::DeepInfra.OpenAIFile? Type223 { get; set; } /// /// /// - public global::DeepInfra.RateLimitRequestIn? Type224 { get; set; } + public global::DeepInfra.OpenAIFilePurpose? Type224 { get; set; } /// /// /// - public global::DeepInfra.RequestCostItem? Type225 { get; set; } + public global::DeepInfra.OpenAIImageData? Type225 { get; set; } /// /// /// - public global::DeepInfra.RequestCostQuery? Type226 { get; set; } + public global::DeepInfra.OpenAIImagesResponseFormat? Type226 { get; set; } /// /// /// - public global::DeepInfra.RequestCostResponse? Type227 { get; set; } + public global::DeepInfra.OpenAIImagesGenerationsIn? Type227 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type228 { get; set; } + public global::DeepInfra.OpenAIImagesOut? Type228 { get; set; } /// /// /// - public global::DeepInfra.SchemaOut? Type229 { get; set; } + public global::System.Collections.Generic.IList? Type229 { get; set; } /// /// /// - public global::DeepInfra.SchemaVariantKey? Type230 { get; set; } + public global::DeepInfra.OpenAIModelOut? Type230 { get; set; } /// /// /// - public global::DeepInfra.ScopedJWTIn? Type231 { get; set; } + public global::DeepInfra.OpenAIModelsOut? Type231 { get; set; } /// /// /// - public global::DeepInfra.ScopedJWTOut? Type232 { get; set; } + public global::System.Collections.Generic.IList? Type232 { get; set; } /// /// /// - public global::DeepInfra.SourceTypeEnum? Type233 { get; set; } + public global::DeepInfra.OpenAITextToSpeechIn? Type233 { get; set; } /// /// /// - public global::DeepInfra.SshKeyIn? Type234 { get; set; } + public global::DeepInfra.OpenClawAgentTypeMetaOut? Type234 { get; set; } /// /// /// - public global::DeepInfra.SshKeyOut? Type235 { get; set; } + public global::System.Collections.Generic.IList? Type235 { get; set; } /// /// /// - public global::DeepInfra.UpdateLoraApiRequest? Type236 { get; set; } + public global::DeepInfra.OpenClawPlanOut? Type236 { get; set; } /// /// /// - public global::DeepInfra.WebLiveMetricsOut? Type237 { get; set; } + public global::DeepInfra.OpenClawBackupOut? Type237 { get; set; } /// /// /// - public global::DeepInfra.ContainerRentalsListV1ContainersGetState? Type238 { get; set; } + public global::System.Collections.Generic.Dictionary? Type238 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type239 { get; set; } + public global::DeepInfra.OpenClawCreateIn? Type239 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type240 { get; set; } + public global::DeepInfra.OpenClawCreateOut? Type240 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type241 { get; set; } + public global::DeepInfra.OpenClawInstanceOut? Type241 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type242 { get; set; } + public global::DeepInfra.OpenClawLaunchTokenOut? Type242 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type243 { get; set; } + public global::DeepInfra.OpenClawUpdateIn? Type243 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type244 { get; set; } + public global::DeepInfra.OpenRouterDatacenter? Type244 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type245 { get; set; } + public global::DeepInfra.OpenRouterModelData? Type245 { get; set; } + /// + /// + /// + public global::DeepInfra.OpenRouterPricing? Type246 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type247 { get; set; } + /// + /// + /// + public global::DeepInfra.OpenRouterModelsOut? Type248 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type249 { get; set; } + /// + /// + /// + public global::DeepInfra.PresetConfigOut? Type250 { get; set; } + /// + /// + /// + public global::DeepInfra.PricingPageEntryOut? Type251 { get; set; } + /// + /// + /// + public global::DeepInfra.PricingType? Type252 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type253 { get; set; } + /// + /// + /// + public global::DeepInfra.RateLimitOut? Type254 { get; set; } + /// + /// + /// + public global::DeepInfra.RateLimitRequestIn? Type255 { get; set; } + /// + /// + /// + public global::DeepInfra.RequestCostItem? Type256 { get; set; } + /// + /// + /// + public global::DeepInfra.RequestCostQuery? Type257 { get; set; } + /// + /// + /// + public global::DeepInfra.RequestCostResponse? Type258 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type259 { get; set; } + /// + /// + /// + public global::DeepInfra.SchemaOut? Type260 { get; set; } + /// + /// + /// + public global::DeepInfra.SchemaVariantKey? Type261 { get; set; } + /// + /// + /// + public global::DeepInfra.ScopedJWTIn? Type262 { get; set; } + /// + /// + /// + public global::DeepInfra.ScopedJWTOut? Type263 { get; set; } + /// + /// + /// + public global::DeepInfra.SourceTypeEnum? Type264 { get; set; } + /// + /// + /// + public global::DeepInfra.SshKeyIn? Type265 { get; set; } + /// + /// + /// + public global::DeepInfra.SshKeyOut? Type266 { get; set; } + /// + /// + /// + public global::DeepInfra.StandardArgsKvCacheDtype2? Type267 { get; set; } + /// + /// + /// + public global::DeepInfra.StandardArgsQuantization2? Type268 { get; set; } + /// + /// + /// + public global::DeepInfra.TokenizeIn? Type269 { get; set; } + /// + /// + /// + public global::DeepInfra.TokenizeOut? Type270 { get; set; } + /// + /// + /// + public global::DeepInfra.UpdateLoraApiRequest? Type271 { get; set; } + /// + /// + /// + public global::DeepInfra.VideoGenerationIn? Type272 { get; set; } + /// + /// + /// + public global::DeepInfra.VideoGenerationOut? Type273 { get; set; } + /// + /// + /// + public global::DeepInfra.WebLiveMetricsOut? Type274 { get; set; } + /// + /// + /// + public global::DeepInfra.ContainerRentalsListV1ContainersGetState? Type275 { get; set; } + /// + /// + /// + public global::DeepInfra.OpenclawListV1AgentsGetState? Type276 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type277 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type278 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type279 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type280 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type281 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type282 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type283 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type284 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type285 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type286 { get; set; } /// /// @@ -1017,111 +1181,111 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType1 { get; set; } + public global::System.Collections.Generic.List? ListType1 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType2 { get; set; } + public global::System.Collections.Generic.List? ListType2 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType3 { get; set; } + public global::System.Collections.Generic.List? ListType3 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType4 { get; set; } + public global::System.Collections.Generic.List>? ListType4 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, object>? ListType5 { get; set; } + public global::System.Collections.Generic.List? ListType5 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType6 { get; set; } + public global::DeepInfra.AnyOf, object>? ListType6 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType7 { get; set; } + public global::System.Collections.Generic.List? ListType7 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType8 { get; set; } + public global::System.Collections.Generic.List? ListType8 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType10 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType11 { get; set; } /// /// /// - 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::DeepInfra.AnyOf, object>? ListType13 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? 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::DeepInfra.AnyOf>? ListType16 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::System.Collections.Generic.Dictionary>>? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? ListType19 { get; set; } + public global::System.Collections.Generic.List>? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType23 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType24 { get; set; } + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType25 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType26 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List>? ListType27 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } /// /// /// @@ -1137,62 +1301,86 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType31 { get; set; } + public global::DeepInfra.AnyOf>>>? ListType31 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List>>? ListType32 { get; set; } + /// + /// + /// + public global::DeepInfra.AnyOf>? ListType33 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType34 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType35 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType36 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType37 { get; set; } /// /// /// - public global::DeepInfra.AnyOf, string>? ListType32 { get; set; } + public global::System.Collections.Generic.List? ListType38 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType33 { get; set; } + public global::System.Collections.Generic.List? ListType39 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType34 { get; set; } + public global::System.Collections.Generic.List? ListType40 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType35 { get; set; } + public global::System.Collections.Generic.List? ListType41 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType36 { get; set; } + public global::System.Collections.Generic.List? ListType42 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType37 { get; set; } + public global::System.Collections.Generic.List? ListType43 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType38 { get; set; } + public global::System.Collections.Generic.List? ListType44 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType39 { get; set; } + public global::System.Collections.Generic.List? ListType45 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType40 { get; set; } + public global::System.Collections.Generic.List? ListType46 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType41 { get; set; } + public global::System.Collections.Generic.List? ListType47 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType42 { get; set; } + public global::System.Collections.Generic.List? ListType48 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType43 { get; set; } + public global::System.Collections.Generic.List? ListType49 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType44 { get; set; } + public global::System.Collections.Generic.List? ListType50 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType45 { get; set; } + public global::System.Collections.Generic.List? ListType51 { 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..99bd63fa --- /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..c1c8ca30 --- /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..592ffc4e --- /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..f38bf9b9 --- /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..1b96c0f7 --- /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..f78d1f34 --- /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..18a8ef03 --- /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..5e4c242d --- /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..72e6fe4b --- /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..943149f8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LoRAAdaptersClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Create, manage, and query LoRA adapter models.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class LoRAAdaptersClient : global::DeepInfra.ILoRAAdaptersClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the LoRAAdaptersClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LoRAAdaptersClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LoRAAdaptersClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LoRAAdaptersClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LoRAAdaptersClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LoRAAdaptersClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.DeploymentLogsQuery.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.DeploymentLogsQuery.g.cs new file mode 100644 index 00000000..c7440420 --- /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..e5b30b94 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetLiveMetrics.g.cs @@ -0,0 +1,417 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class LogsMetricsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_GetLiveMetricsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_GetLiveMetricsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_GetLiveMetricsSecurityRequirement0, + }; + partial void PrepareGetLiveMetricsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareGetLiveMetricsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessGetLiveMetricsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetLiveMetricsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Live Metrics
+ /// Get the latest values for the Live metrics section on the web front page. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetLiveMetricsAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetLiveMetricsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Live Metrics
+ /// Get the latest values for the Live metrics section on the web front page. + ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetLiveMetricsAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetLiveMetricsArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetLiveMetricsSecurityRequirements, + operationName: "GetLiveMetricsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/v1/metrics/live", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetLiveMetricsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetLiveMetricsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetLiveMetrics", + methodName: "GetLiveMetricsAsync", + pathTemplate: "\"/v1/metrics/live\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetLiveMetricsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.WebLiveMetricsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.WebLiveMetricsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetRequestCosts.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.GetRequestCosts.g.cs new file mode 100644 index 00000000..012bc4c8 --- /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..57e3520f --- /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..fdf4992e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.LogsMetricsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Query inference logs, deployment logs, and usage metrics.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class LogsMetricsClient : global::DeepInfra.ILogsMetricsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the LogsMetricsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LogsMetricsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LogsMetricsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LogsMetricsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the LogsMetricsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public LogsMetricsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..8fcec5bb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AccountEmailValuesV1MeEmailsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.AccountEmailValuesV1MeEmailsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AccountEmailValuesV1MeEmailsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.AccountEmailValuesV1MeEmailsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountEmailValuesV1MeEmailsGetXApiKey? 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.AccountEmailValuesV1MeEmailsGetXApiKey? 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.AccountEmailValuesV1MeEmailsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountEmailValuesV1MeEmailsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AccountEmailValuesV1MeEmailsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXApiKey.g.cs new file mode 100644 index 00000000..008dff4e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AccountEmailValuesV1MeEmailsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index 9fcfdfd6..4f3d38ce 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AccountEmailValuesV1MeEmailsGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountEmailValuesV1MeEmailsGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountEmailValuesV1MeEmailsGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 897628a3..9c90adf8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountEmailValuesV1MeEmailsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountEmailValuesV1MeEmailsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXApiKey.Json.g.cs new file mode 100644 index 00000000..ac2987ac --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AccountGpuLimitV1MeGpuLimitGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.AccountGpuLimitV1MeGpuLimitGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXApiKey), + jsonSerializerContext) as global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXApiKey? 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.AccountGpuLimitV1MeGpuLimitGetXApiKey? 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.AccountGpuLimitV1MeGpuLimitGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AccountGpuLimitV1MeGpuLimitGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXApiKey.g.cs new file mode 100644 index 00000000..69495d29 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AccountGpuLimitV1MeGpuLimitGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index a7620a50..69fd3afb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountGpuLimitV1MeGpuLimitGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index cced60f7..0956566a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountGpuLimitV1MeGpuLimitGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountGpuLimitV1MeGpuLimitGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXApiKey.Json.g.cs new file mode 100644 index 00000000..b51b1480 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AccountRateLimitV1MeRateLimitGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.AccountRateLimitV1MeRateLimitGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AccountRateLimitV1MeRateLimitGetXApiKey), + jsonSerializerContext) as global::DeepInfra.AccountRateLimitV1MeRateLimitGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountRateLimitV1MeRateLimitGetXApiKey? 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.AccountRateLimitV1MeRateLimitGetXApiKey? 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.AccountRateLimitV1MeRateLimitGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountRateLimitV1MeRateLimitGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AccountRateLimitV1MeRateLimitGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXApiKey.g.cs new file mode 100644 index 00000000..e84c2103 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AccountRateLimitV1MeRateLimitGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 3c89ec84..6a03bcc7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AccountRateLimitV1MeRateLimitGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountRateLimitV1MeRateLimitGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountRateLimitV1MeRateLimitGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 90a92acb..2ebd7c2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountRateLimitV1MeRateLimitGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountRateLimitV1MeRateLimitGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.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..00777858 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountUpdateDetailsV1MePatchResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXApiKey.Json.g.cs new file mode 100644 index 00000000..92349686 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AccountUpdateDetailsV1MePatchXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.AccountUpdateDetailsV1MePatchXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AccountUpdateDetailsV1MePatchXApiKey), + jsonSerializerContext) as global::DeepInfra.AccountUpdateDetailsV1MePatchXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountUpdateDetailsV1MePatchXApiKey? 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.AccountUpdateDetailsV1MePatchXApiKey? 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.AccountUpdateDetailsV1MePatchXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountUpdateDetailsV1MePatchXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AccountUpdateDetailsV1MePatchXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXApiKey.g.cs new file mode 100644 index 00000000..15a56eeb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AccountUpdateDetailsV1MePatchXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 21b3f0c0..67a774e9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AccountUpdateDetailsV1MePatchXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AccountUpdateDetailsV1MePatchXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AccountUpdateDetailsV1MePatchXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ba332eec..f40fa831 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AccountUpdateDetailsV1MePatchXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AccountUpdateDetailsV1MePatchXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.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..d6d70466 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.cs @@ -42,5 +42,6 @@ public AddFundsIn( public AddFundsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOut.Json.g.cs new file mode 100644 index 00000000..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..f6631fb0 --- /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.AddFundsOutCheckoutUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.Json.g.cs new file mode 100644 index 00000000..869ff6e0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AddFundsOutCheckoutUrl + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.AddFundsOutCheckoutUrl? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AddFundsOutCheckoutUrl), + jsonSerializerContext) as global::DeepInfra.AddFundsOutCheckoutUrl; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AddFundsOutCheckoutUrl? 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.AddFundsOutCheckoutUrl? 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.AddFundsOutCheckoutUrl), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsOutCheckoutUrl; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AddFundsOutCheckoutUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.g.cs new file mode 100644 index 00000000..fe01e023 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsOutCheckoutUrl.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Stripe Checkout Session URL to complete payment. Non-null when no saved payment method is on file. + /// + public sealed partial class AddFundsOutCheckoutUrl + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs deleted file mode 100644 index 8530a926..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class AddFundsPaymentFundsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.AddFundsPaymentFundsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.AddFundsPaymentFundsPostResponse), - jsonSerializerContext) as global::DeepInfra.AddFundsPaymentFundsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.AddFundsPaymentFundsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.AddFundsPaymentFundsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AddFundsPaymentFundsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs deleted file mode 100644 index 7b4a592a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class AddFundsPaymentFundsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.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..6873bdf1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class AddFundsPaymentFundsPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceState.g.cs new file mode 100644 index 00000000..a89a4586 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AgentInstanceState.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public enum AgentInstanceState + { + /// + /// + /// + Creating, + /// + /// + /// + Deleted, + /// + /// + /// + Failed, + /// + /// + /// + Running, + /// + /// + /// + Starting, + /// + /// + /// + Stopped, + /// + /// + /// + Stopping, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentInstanceStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentInstanceState value) + { + return value switch + { + AgentInstanceState.Creating => "creating", + AgentInstanceState.Deleted => "deleted", + AgentInstanceState.Failed => "failed", + AgentInstanceState.Running => "running", + AgentInstanceState.Starting => "starting", + AgentInstanceState.Stopped => "stopped", + AgentInstanceState.Stopping => "stopping", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentInstanceState? ToEnum(string value) + { + return value switch + { + "creating" => AgentInstanceState.Creating, + "deleted" => AgentInstanceState.Deleted, + "failed" => AgentInstanceState.Failed, + "running" => AgentInstanceState.Running, + "starting" => AgentInstanceState.Starting, + "stopped" => AgentInstanceState.Stopped, + "stopping" => AgentInstanceState.Stopping, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs index 872e5f9b..05297dfc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f26abc2d..62d4fc6f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicBeta.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicBet /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs index 6e646133..2ebb731d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b0f7439a..9db375e9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostAnthropicVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostAnthropicVer /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.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..782ee3e7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.Json.g.cs index 000f53dc..6d1b3050 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4aff8291..38e84311 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs index 689995c1..eec849a5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d8f498ad..0dfd2ed8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXDeepinfraSo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..10a50ed1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.AnthropicMessagesAnthropicV1MessagesPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXiApiKey? 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.AnthropicMessagesAnthropicV1MessagesPostXiApiKey? 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.AnthropicMessagesAnthropicV1MessagesPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesAnthropicV1MessagesPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AnthropicMessagesAnthropicV1MessagesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXiApiKey.g.cs new file mode 100644 index 00000000..4e70dcaa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesAnthropicV1MessagesPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AnthropicMessagesAnthropicV1MessagesPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..a1ec65d9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.Json.g.cs index ff157422..86d462ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ab9f3484..eb829d4f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..500c8d9c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey? 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey? 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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey.g.cs new file mode 100644 index 00000000..ae143613 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class AnthropicMessagesCountTokensAnthropicV1MessagesCountTokensPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..2bb23875 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesIn.g.cs @@ -154,5 +154,6 @@ public AnthropicMessagesIn( public AnthropicMessagesIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs index 8136fb73..4a697a9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInMaxTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInMaxTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInMaxTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f5e8aafe..657413f0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.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..f1c14938 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMessage.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMessage /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.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..1fc1cacb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.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..cc54f9b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInMetadata2.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInMetadata2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.Json.g.cs index e641dacf..5933ea81 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInStopSequences; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInStopSequences? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInStopSequences; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 08c0f2dc..e9374a32 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInStopSequences.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInStopSequences /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.Json.g.cs index 867fe894..bafc99f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTemperature; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInTemperature? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTemperature; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e3bb5f93..372a6e2f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTemperature.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTemperature /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.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..c4264a53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInThinking.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInThinking /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.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..f3389791 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInToolChoice /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.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..dcb88873 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInToolChoice2.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInToolChoice2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.Json.g.cs index 56f86bb5..2fb0d9f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTools; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInTools? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTools; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index da4111cd..cb74da1e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTools.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTools /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.Json.g.cs index 1ebbac2f..667958b0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTopK; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInTopK? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTopK; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 69183ce5..a61e6866 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopK.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTopK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.Json.g.cs index bde161e5..ea165909 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicMessagesInTopP; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicMessagesInTopP? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicMessagesInTopP; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d91780ed..87683feb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicMessagesInTopP.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicMessagesInTopP /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.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..89152176 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicSystemContent.g.cs @@ -50,5 +50,18 @@ public AnthropicSystemContent( public AnthropicSystemContent() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static AnthropicSystemContent FromText(string text) + { + return new AnthropicSystemContent + { + Text = text, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.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..d59cd7d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicThinkingConfig.g.cs @@ -41,5 +41,6 @@ public AnthropicThinkingConfig( public AnthropicThinkingConfig() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.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..f3cf897b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequest.g.cs @@ -87,5 +87,6 @@ public AnthropicTokenCountRequest( public AnthropicTokenCountRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.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..ef04082f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestMessage.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestMessage /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.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..fdac1da8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestThinking.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestThinking /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.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..007cf53c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestToolChoice /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.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..94fb88b7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestToolChoice2.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestToolChoice2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.Json.g.cs index 056683ab..1af58536 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicTokenCountRequestTools; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicTokenCountRequestTools? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicTokenCountRequestTools; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 47bf2e1e..d3eec50c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTokenCountRequestTools.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicTokenCountRequestTools /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.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..dfdc2624 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicTool.g.cs @@ -59,5 +59,6 @@ public AnthropicTool( public AnthropicTool() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs index 176a3a80..7512122c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.AnthropicToolDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.AnthropicToolDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.AnthropicToolDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d9ad7a8b..1832ae7e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicToolDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.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..8dc258db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.AnthropicToolInputSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class AnthropicToolInputSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.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..777e29bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiToken.g.cs @@ -81,5 +81,6 @@ public ApiToken( public ApiToken() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs index a68220b6..1a6183bb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ApiTokenAllowedIps; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ApiTokenAllowedIps? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiTokenAllowedIps; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 14d823cc..94cc3524 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenAllowedIps.g.cs @@ -14,5 +14,6 @@ public sealed partial class ApiTokenAllowedIps /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.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..7b3b63c8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenIn.g.cs @@ -40,5 +40,6 @@ public ApiTokenIn( public ApiTokenIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs index c2469a3c..2b7f714d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ApiTokenTokenId; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ApiTokenTokenId? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ApiTokenTokenId; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index cc96cf6d..9ee9dab2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenTokenId.g.cs @@ -14,5 +14,6 @@ public sealed partial class ApiTokenTokenId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.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..f905cbe9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ApiTokenVercelExportIn.g.cs @@ -80,5 +80,6 @@ public ApiTokenVercelExportIn( public ApiTokenVercelExportIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..ab63d963 --- /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.BatchErrorDataCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataCode.Json.g.cs new file mode 100644 index 00000000..a0177390 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataCode.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchErrorDataCode + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BatchErrorDataCode? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchErrorDataCode), + jsonSerializerContext) as global::DeepInfra.BatchErrorDataCode; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrorDataCode? 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.BatchErrorDataCode? 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.BatchErrorDataCode), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchErrorDataCode; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BatchErrorDataCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataCode.g.cs new file mode 100644 index 00000000..45ed4fef --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataCode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// An error code identifying the error type. + /// + public sealed partial class BatchErrorDataCode + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataLine.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataLine.Json.g.cs new file mode 100644 index 00000000..1b6db0b0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataLine.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchErrorDataLine + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BatchErrorDataLine? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchErrorDataLine), + jsonSerializerContext) as global::DeepInfra.BatchErrorDataLine; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrorDataLine? 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.BatchErrorDataLine? 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.BatchErrorDataLine), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchErrorDataLine; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BatchErrorDataLine.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataLine.g.cs new file mode 100644 index 00000000..bff33afb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataLine.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The line number of the input file where the error occurred. + /// + public sealed partial class BatchErrorDataLine + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataMessage.Json.g.cs new file mode 100644 index 00000000..15845737 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataMessage.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchErrorDataMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BatchErrorDataMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchErrorDataMessage), + jsonSerializerContext) as global::DeepInfra.BatchErrorDataMessage; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrorDataMessage? 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.BatchErrorDataMessage? 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.BatchErrorDataMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchErrorDataMessage; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BatchErrorDataMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataMessage.g.cs new file mode 100644 index 00000000..3aa941c7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataMessage.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// A human-readable message describing the error. + /// + public sealed partial class BatchErrorDataMessage + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataParam.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataParam.Json.g.cs new file mode 100644 index 00000000..ebe62082 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataParam.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BatchErrorDataParam + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BatchErrorDataParam? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BatchErrorDataParam), + jsonSerializerContext) as global::DeepInfra.BatchErrorDataParam; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BatchErrorDataParam? 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.BatchErrorDataParam? 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.BatchErrorDataParam), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BatchErrorDataParam; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BatchErrorDataParam.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataParam.g.cs new file mode 100644 index 00000000..065c114b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BatchErrorDataParam.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The name of the parameter that caused the error. + /// + public sealed partial class BatchErrorDataParam + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..c805fa06 --- /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..a8dda882 --- /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..225e7919 --- /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..d334d642 --- /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..ced0aee4 --- /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..9ce5a584 --- /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..bb6ba47f --- /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.BillingAddressOutCity.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCity.Json.g.cs new file mode 100644 index 00000000..cbf3bba2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCity.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutCity + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutCity? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutCity), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutCity; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutCity? 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.BillingAddressOutCity? 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.BillingAddressOutCity), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutCity; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutCity.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCity.g.cs new file mode 100644 index 00000000..4332daae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCity.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutCity + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCountry.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCountry.Json.g.cs new file mode 100644 index 00000000..79f640c0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCountry.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutCountry + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutCountry? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutCountry), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutCountry; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutCountry? 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.BillingAddressOutCountry? 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.BillingAddressOutCountry), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutCountry; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutCountry.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCountry.g.cs new file mode 100644 index 00000000..c30e2634 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutCountry.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutCountry + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine1.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine1.Json.g.cs new file mode 100644 index 00000000..ed45cb1b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine1.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutLine1 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutLine1? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutLine1), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutLine1; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutLine1? 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.BillingAddressOutLine1? 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.BillingAddressOutLine1), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutLine1; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutLine1.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine1.g.cs new file mode 100644 index 00000000..e06e74f3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine1.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutLine1 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine2.Json.g.cs new file mode 100644 index 00000000..74687faf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutLine2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutLine2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutLine2), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutLine2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutLine2? 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.BillingAddressOutLine2? 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.BillingAddressOutLine2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutLine2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutLine2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine2.g.cs new file mode 100644 index 00000000..40937335 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutLine2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutLine2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutName.Json.g.cs new file mode 100644 index 00000000..ac4e19ed --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutName.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutName + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutName? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutName), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutName; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutName? 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.BillingAddressOutName? 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.BillingAddressOutName), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutName; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutName.g.cs new file mode 100644 index 00000000..45561172 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutName.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutName + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutPostalCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutPostalCode.Json.g.cs new file mode 100644 index 00000000..f29341db --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutPostalCode.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutPostalCode + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutPostalCode? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutPostalCode), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutPostalCode; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutPostalCode? 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.BillingAddressOutPostalCode? 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.BillingAddressOutPostalCode), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutPostalCode; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutPostalCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutPostalCode.g.cs new file mode 100644 index 00000000..9e8b841f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutPostalCode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutPostalCode + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutState.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutState.Json.g.cs new file mode 100644 index 00000000..6dae41d5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutState.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class BillingAddressOutState + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.BillingAddressOutState? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.BillingAddressOutState), + jsonSerializerContext) as global::DeepInfra.BillingAddressOutState; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingAddressOutState? 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.BillingAddressOutState? 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.BillingAddressOutState), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingAddressOutState; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.BillingAddressOutState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutState.g.cs new file mode 100644 index 00000000..cba39c7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingAddressOutState.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class BillingAddressOutState + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.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..64f3ee63 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.cs @@ -40,5 +40,6 @@ public BillingPortalOut( public BillingPortalOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs index cf07f584..16f3d530 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BillingPortalPaymentBillingPortalGetReturnUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BillingPortalPaymentBillingPortalGetReturnUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BillingPortalPaymentBillingPortalGetReturnUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 71441528..11c7ed42 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class BillingPortalPaymentBillingPortalGetReturnUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.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..825dc5a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class BillingPortalPaymentBillingPortalGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.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..b52bce2b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyCreateVoiceV1VoicesAddPost.g.cs @@ -60,5 +60,6 @@ public BodyCreateVoiceV1VoicesAddPost( public BodyCreateVoiceV1VoicesAddPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.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..92104e59 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost.g.cs @@ -109,5 +109,6 @@ public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost( public BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs index 593529ae..423b57a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4cebfbc2..ff327f2f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostLanguage.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs index 0394a494..fb0cff86 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1d16811c..f695f5eb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostPrompt.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs index adaf5a05..9a47aaca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs index 397d33e4..32d8afeb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index bfd9426a..fa09713d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTemperature.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs index b1bfd743..dda8daa9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 86389fca..8fc14345 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPostTimestampGranularities.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranscriptionsV1AudioTranscriptionsPo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.Json.g.cs deleted file mode 100644 index 18508302..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.g.cs deleted file mode 100644 index b34c6a64..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost.g.cs +++ /dev/null @@ -1,113 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] File { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Filename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("language")] - public string? Language { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Default Value: json - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] - public global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? ResponseFormat { get; set; } - - /// - /// Default Value: 0 - /// - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public double? Temperature { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("timestamp_granularities")] - public global::System.Collections.Generic.IList? TimestampGranularities { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost( - byte[] file, - string filename, - string model, - string? language, - string? prompt, - global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? responseFormat, - double? temperature, - global::System.Collections.Generic.IList? timestampGranularities) - { - this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); - this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - this.Language = language; - this.Prompt = prompt; - this.ResponseFormat = responseFormat; - this.Temperature = temperature; - this.TimestampGranularities = timestampGranularities; - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.Json.g.cs deleted file mode 100644 index d515a499..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.g.cs deleted file mode 100644 index 50c77eed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostLanguage - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.Json.g.cs deleted file mode 100644 index 983c3700..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.g.cs deleted file mode 100644 index 5ed02d8f..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostPrompt - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.Json.g.cs deleted file mode 100644 index c0bcf406..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.g.cs deleted file mode 100644 index b9cf6773..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: json - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs deleted file mode 100644 index 49fdb84c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public enum BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 - { - /// - /// - /// - Json, - /// - /// - /// - Srt, - /// - /// - /// - Text, - /// - /// - /// - VerboseJson, - /// - /// - /// - Vtt, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2 value) - { - return value switch - { - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Json => "json", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Srt => "srt", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Text => "text", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.VerboseJson => "verbose_json", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Vtt => "vtt", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2? ToEnum(string value) - { - return value switch - { - "json" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Json, - "srt" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Srt, - "text" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Text, - "verbose_json" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.VerboseJson, - "vtt" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponseFormat2.Vtt, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.Json.g.cs deleted file mode 100644 index 305d7089..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.g.cs deleted file mode 100644 index d7d5fb3b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 0 - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTemperature - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.Json.g.cs deleted file mode 100644 index 8c6be9d7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.g.cs deleted file mode 100644 index 3fd8ffb8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularities - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs deleted file mode 100644 index a8cc1eb5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.g.cs +++ /dev/null @@ -1,51 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public enum BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item - { - /// - /// - /// - Segment, - /// - /// - /// - Word, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1ItemExtensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item value) - { - return value switch - { - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Segment => "segment", - BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Word => "word", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item? ToEnum(string value) - { - return value switch - { - "segment" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Segment, - "word" => BodyOpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostTimestampGranularitiesVariant1Item.Word, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.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..67bf891c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPost.g.cs @@ -91,5 +91,6 @@ public BodyOpenaiAudioTranslationsV1AudioTranslationsPost( public BodyOpenaiAudioTranslationsV1AudioTranslationsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs index 6beffaa5..844d31cb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d57b2e35..5171828f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostPrompt.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostPr /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs index e821bb43..380afbd2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs index b2d3cab0..6833aa4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0b2160b9..b4ba6c10 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1AudioTranslationsPostTemperature.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiAudioTranslationsV1AudioTranslationsPostTe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.Json.g.cs deleted file mode 100644 index 82d90dc3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.g.cs deleted file mode 100644 index 630aafe5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost.g.cs +++ /dev/null @@ -1,95 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] File { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("filename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Filename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - public string? Prompt { get; set; } - - /// - /// Default Value: json - /// - [global::System.Text.Json.Serialization.JsonPropertyName("response_format")] - public global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? ResponseFormat { get; set; } - - /// - /// Default Value: 0 - /// - [global::System.Text.Json.Serialization.JsonPropertyName("temperature")] - public double? Temperature { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - /// Default Value: json - /// - /// - /// Default Value: 0 - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost( - byte[] file, - string filename, - string model, - string? prompt, - global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? responseFormat, - double? temperature) - { - this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); - this.Filename = filename ?? throw new global::System.ArgumentNullException(nameof(filename)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - this.Prompt = prompt; - this.ResponseFormat = responseFormat; - this.Temperature = temperature; - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.Json.g.cs deleted file mode 100644 index 592f66fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.g.cs deleted file mode 100644 index f0a399de..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostPrompt - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.Json.g.cs deleted file mode 100644 index 4f231945..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.g.cs deleted file mode 100644 index 8cfba36a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: json - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs deleted file mode 100644 index 07f27fe7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.g.cs +++ /dev/null @@ -1,69 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public enum BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 - { - /// - /// - /// - Json, - /// - /// - /// - Srt, - /// - /// - /// - Text, - /// - /// - /// - VerboseJson, - /// - /// - /// - Vtt, - } - - /// - /// Enum extensions to do fast conversions without the reflection. - /// - public static class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2Extensions - { - /// - /// Converts an enum to a string. - /// - public static string ToValueString(this BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2 value) - { - return value switch - { - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Json => "json", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Srt => "srt", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Text => "text", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.VerboseJson => "verbose_json", - BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Vtt => "vtt", - _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), - }; - } - /// - /// Converts an string to a enum. - /// - public static BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2? ToEnum(string value) - { - return value switch - { - "json" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Json, - "srt" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Srt, - "text" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Text, - "verbose_json" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.VerboseJson, - "vtt" => BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponseFormat2.Vtt, - _ => null, - }; - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.Json.g.cs deleted file mode 100644 index c26fa515..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.g.cs deleted file mode 100644 index d46bf9a4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// Default Value: 0 - /// - public sealed partial class BodyOpenaiAudioTranslationsV1OpenaiAudioTranslationsPostTemperature - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.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..c5f32d13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1FilesPost.g.cs @@ -50,5 +50,6 @@ public BodyOpenaiFilesV1FilesPost( public BodyOpenaiFilesV1FilesPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.Json.g.cs deleted file mode 100644 index 10447d5e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiFilesV1OpenaiFilesPost - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiFilesV1OpenaiFilesPost; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.g.cs deleted file mode 100644 index b4b26c67..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiFilesV1OpenaiFilesPost.g.cs +++ /dev/null @@ -1,54 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiFilesV1OpenaiFilesPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("purpose")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Purpose { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("file")] - [global::System.Text.Json.Serialization.JsonRequired] - public required global::System.Collections.Generic.IList File { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiFilesV1OpenaiFilesPost( - string purpose, - global::System.Collections.Generic.IList file) - { - this.Purpose = purpose ?? throw new global::System.ArgumentNullException(nameof(purpose)); - this.File = file ?? throw new global::System.ArgumentNullException(nameof(file)); - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiFilesV1OpenaiFilesPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.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..da90f3c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPost.g.cs @@ -79,5 +79,6 @@ public BodyOpenaiImagesEditsV1ImagesEditsPost( public BodyOpenaiImagesEditsV1ImagesEditsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.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..a316417b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1ImagesEditsPostInp.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiImagesEditsV1ImagesEditsPostInp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.Json.g.cs deleted file mode 100644 index 3b89a929..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPost - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.g.cs deleted file mode 100644 index 13564da4..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPost.g.cs +++ /dev/null @@ -1,83 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inp")] - public global::DeepInfra.OpenAIImagesEditsIn? Inp { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("prompt")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Prompt { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiImagesEditsV1OpenaiImagesEditsPost( - byte[] image, - string imagename, - string prompt, - string model, - global::DeepInfra.OpenAIImagesEditsIn? inp) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Inp = inp; - this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiImagesEditsV1OpenaiImagesEditsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.Json.g.cs deleted file mode 100644 index de1bb885..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.g.cs deleted file mode 100644 index 1e7d902d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesEditsV1OpenaiImagesEditsPostInp - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.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..b8f9963f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPost.g.cs @@ -69,5 +69,6 @@ public BodyOpenaiImagesVariationsV1ImagesVariationsPost( public BodyOpenaiImagesVariationsV1ImagesVariationsPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.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..bc00ac08 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1ImagesVariationsPostInp.g.cs @@ -14,5 +14,6 @@ public sealed partial class BodyOpenaiImagesVariationsV1ImagesVariationsPostInp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.Json.g.cs deleted file mode 100644 index 1ada112b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.g.cs deleted file mode 100644 index d47dd3bb..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost.g.cs +++ /dev/null @@ -1,73 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost - { - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("image")] - [global::System.Text.Json.Serialization.JsonRequired] - public required byte[] Image { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("imagename")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Imagename { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("inp")] - public global::DeepInfra.OpenAIImagesVariationsIn? Inp { get; set; } - - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonRequired] - public required string Model { get; set; } - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// -#if NET7_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] -#endif - public BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost( - byte[] image, - string imagename, - string model, - global::DeepInfra.OpenAIImagesVariationsIn? inp) - { - this.Image = image ?? throw new global::System.ArgumentNullException(nameof(image)); - this.Imagename = imagename ?? throw new global::System.ArgumentNullException(nameof(imagename)); - this.Inp = inp; - this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); - } - - /// - /// Initializes a new instance of the class. - /// - public BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPost() - { - } - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.Json.g.cs deleted file mode 100644 index 63c6fee3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp), - jsonSerializerContext) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.g.cs deleted file mode 100644 index 0c56d3e7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class BodyOpenaiImagesVariationsV1OpenaiImagesVariationsPostInp - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.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..97d0bcba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.BodyUpdateVoiceV1VoicesVoiceIdEditPost.g.cs @@ -50,5 +50,6 @@ public BodyUpdateVoiceV1VoicesVoiceIdEditPost( public BodyUpdateVoiceV1VoicesVoiceIdEditPost() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey.Json.g.cs new file mode 100644 index 00000000..2b5f9d19 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey? 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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey? 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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey.g.cs new file mode 100644 index 00000000..80586b4f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CancelOpenaiBatchV1BatchesBatchIdCancelPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..d46bc157 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey? 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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey? 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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey.g.cs new file mode 100644 index 00000000..63aacb70 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CancelOpenaiBatchV1BatchesBatchIdCancelPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..130245c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessage.g.cs @@ -97,5 +97,6 @@ public ChatCompletionAssistantMessage( public ChatCompletionAssistantMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl.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..a2e43097 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.Json.g.cs index 3dc16a4b..a2b7785d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionAssistantMessageName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4f925db1..c19efb03 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.Json.g.cs index 03e4239f..89ad3174 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageReasoningContent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionAssistantMessageReasoningContent? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageReasoningContent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e17d7fed..5fd59d9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageReasoningContent.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageReasoningContent /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.Json.g.cs index 1b073b98..5fed10b4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionAssistantMessageToolCalls; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionAssistantMessageToolCalls? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionAssistantMessageToolCalls; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 78b41ed8..03e71494 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionAssistantMessageToolCalls.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionAssistantMessageToolCalls /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.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..5a4dde2e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartAudio.g.cs @@ -50,5 +50,18 @@ public ChatCompletionContentPartAudio( public ChatCompletionContentPartAudio() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartAudio FromInputAudio(global::DeepInfra.InputAudio inputAudio) + { + return new ChatCompletionContentPartAudio + { + InputAudio = inputAudio, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.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..e0592ac7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartImage.g.cs @@ -50,5 +50,18 @@ public ChatCompletionContentPartImage( public ChatCompletionContentPartImage() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartImage FromImageUrl(global::DeepInfra.ImageURL imageUrl) + { + return new ChatCompletionContentPartImage + { + ImageUrl = imageUrl, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.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..f5389fad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartText.g.cs @@ -50,5 +50,18 @@ public ChatCompletionContentPartText( public ChatCompletionContentPartText() { } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartText FromText(string text) + { + return new ChatCompletionContentPartText + { + Text = text, + }; + } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.Json.g.cs new file mode 100644 index 00000000..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..845933df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionContentPartVideo.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChatCompletionContentPartVideo + { + /// + /// + /// + /// "video_url" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = "video_url"; + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("video_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.VideoURL VideoUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ChatCompletionContentPartVideo( + global::DeepInfra.VideoURL videoUrl, + string type = "video_url") + { + this.Type = type; + this.VideoUrl = videoUrl ?? throw new global::System.ArgumentNullException(nameof(videoUrl)); + } + + /// + /// Initializes a new instance of the class. + /// + public ChatCompletionContentPartVideo() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static ChatCompletionContentPartVideo FromVideoUrl(global::DeepInfra.VideoURL videoUrl) + { + return new ChatCompletionContentPartVideo + { + VideoUrl = videoUrl, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.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..ec52b4c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionMessageToolCall.g.cs @@ -66,5 +66,6 @@ public ChatCompletionMessageToolCall( public ChatCompletionMessageToolCall() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.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..80ab522d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessage.g.cs @@ -76,5 +76,6 @@ public ChatCompletionSystemMessage( public ChatCompletionSystemMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl.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..26926d6b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionSystemMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.Json.g.cs index b94d5b87..c167f180 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionSystemMessageName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionSystemMessageName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionSystemMessageName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b5c099f4..3f1bee17 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionSystemMessageName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionSystemMessageName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.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..b7e560ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessage.g.cs @@ -77,5 +77,6 @@ public ChatCompletionToolMessage( public ChatCompletionToolMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl.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..d3a7d1ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionToolMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionToolMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.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..f3226008 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessage.g.cs @@ -25,9 +25,9 @@ public sealed partial class ChatCompletionUserMessage /// the message content /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter>>))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf>> Content { get; set; } + public required global::DeepInfra.AnyOf>> Content { get; set; } /// /// @@ -59,7 +59,7 @@ public sealed partial class ChatCompletionUserMessage [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ChatCompletionUserMessage( - global::DeepInfra.AnyOf>> content, + global::DeepInfra.AnyOf>> content, object? cacheControl, string? role, string? name) @@ -76,5 +76,6 @@ public ChatCompletionUserMessage( public ChatCompletionUserMessage() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl.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..2611b763 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionUserMessageCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.Json.g.cs index 17d3d52d..cef4f14b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatCompletionUserMessageName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatCompletionUserMessageName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatCompletionUserMessageName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0eeac062..40a06862 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatCompletionUserMessageName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatCompletionUserMessageName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.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..e812e25e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs @@ -52,5 +52,6 @@ public ChatReasoningSettings( public ChatReasoningSettings() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs index 03c1d55b..cde1d20a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatReasoningSettingsEffort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatReasoningSettingsEffort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatReasoningSettingsEffort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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..b06a484b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatReasoningSettingsEffort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs index 9b47859d..559f9a3a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort2.g.cs @@ -20,6 +20,10 @@ public enum ChatReasoningSettingsEffort2 /// /// Medium, + /// + /// + /// + Xhigh, } /// @@ -37,6 +41,7 @@ public static string ToValueString(this ChatReasoningSettingsEffort2 value) ChatReasoningSettingsEffort2.High => "high", ChatReasoningSettingsEffort2.Low => "low", ChatReasoningSettingsEffort2.Medium => "medium", + ChatReasoningSettingsEffort2.Xhigh => "xhigh", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -50,6 +55,7 @@ public static string ToValueString(this ChatReasoningSettingsEffort2 value) "high" => ChatReasoningSettingsEffort2.High, "low" => ChatReasoningSettingsEffort2.Low, "medium" => ChatReasoningSettingsEffort2.Medium, + "xhigh" => ChatReasoningSettingsEffort2.Xhigh, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs index b50d4148..479c0b41 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatReasoningSettingsEnabled; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatReasoningSettingsEnabled? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatReasoningSettingsEnabled; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 740344b9..eb977679 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEnabled.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatReasoningSettingsEnabled /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.Json.g.cs index 66190efe..f6977761 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatTools; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatTools? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatTools; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index caa4ca08..2a097261 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatTools.g.cs @@ -62,5 +62,6 @@ public ChatTools( public ChatTools() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs index e178b817..9a70a30a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatToolsCacheControl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatToolsCacheControl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatToolsCacheControl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 19435e8c..92465d4e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatToolsCacheControl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.Json.g.cs index 852fdc41..b64ebf32 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChatToolsCacheControl2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChatToolsCacheControl2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChatToolsCacheControl2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 6e6926d4..c8fa685d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChatToolsCacheControl2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChatToolsCacheControl2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.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..e5d6899e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs @@ -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 /// @@ -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..d5d7abc2 --- /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.ChecklistBillingType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.Json.g.cs new file mode 100644 index 00000000..099fe59b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChecklistBillingType + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ChecklistBillingType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChecklistBillingType), + jsonSerializerContext) as global::DeepInfra.ChecklistBillingType; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistBillingType? 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.ChecklistBillingType? 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.ChecklistBillingType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistBillingType; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ChecklistBillingType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.g.cs new file mode 100644 index 00000000..d61e2616 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistBillingType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChecklistBillingType + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistIntermediateInvoicingThreshold.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistIntermediateInvoicingThreshold.Json.g.cs new file mode 100644 index 00000000..60fa5256 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistIntermediateInvoicingThreshold.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ChecklistIntermediateInvoicingThreshold + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ChecklistIntermediateInvoicingThreshold? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ChecklistIntermediateInvoicingThreshold), + jsonSerializerContext) as global::DeepInfra.ChecklistIntermediateInvoicingThreshold; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistIntermediateInvoicingThreshold? 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.ChecklistIntermediateInvoicingThreshold? 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.ChecklistIntermediateInvoicingThreshold), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistIntermediateInvoicingThreshold; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ChecklistIntermediateInvoicingThreshold.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistIntermediateInvoicingThreshold.g.cs new file mode 100644 index 00000000..a594662f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistIntermediateInvoicingThreshold.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ChecklistIntermediateInvoicingThreshold + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 55d83fc4..a34d24ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChecklistLimit; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistLimit? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistLimit; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index dd69631a..762df4ef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChecklistLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..99574f4b --- /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 index cb71004e..44213ae5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ChecklistSuspendReason; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ChecklistSuspendReason? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ChecklistSuspendReason; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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..aca17332 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ChecklistSuspendReason.g.cs @@ -14,5 +14,6 @@ public sealed partial class ChecklistSuspendReason /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.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..7b3a93f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CliVersionCliVersionGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class CliVersionCliVersionGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.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..f2355032 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CompletionMultiModalData.g.cs @@ -14,6 +14,12 @@ public sealed partial class CompletionMultiModalData [global::System.Text.Json.Serialization.JsonPropertyName("image")] public global::System.Collections.Generic.IList? Image { get; set; } + /// + /// List of videos as base64 data URIs (e.g. 'data:video/mp4;base64,...'). Each video must correspond to a placeholder token in the prompt. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("video")] + public global::System.Collections.Generic.IList? Video { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -26,13 +32,18 @@ public sealed partial class CompletionMultiModalData /// /// List of images as base64 data URIs (e.g. 'data:image/png;base64,...'). Each image must correspond to a placeholder token in the prompt. /// + /// + /// List of videos as base64 data URIs (e.g. 'data:video/mp4;base64,...'). Each video must correspond to a placeholder token in the prompt. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public CompletionMultiModalData( - global::System.Collections.Generic.IList? image) + global::System.Collections.Generic.IList? image, + global::System.Collections.Generic.IList? video) { this.Image = image; + this.Video = video; } /// @@ -41,5 +52,6 @@ public CompletionMultiModalData( public CompletionMultiModalData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.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..3dd0d847 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.cs @@ -41,5 +41,6 @@ public ConfigIn( public ConfigIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs index c3c50802..3c8112a6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ConfigInLimit; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ConfigInLimit? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ConfigInLimit; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f1d4bee0..08c2c242 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class ConfigInLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.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..d27024bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.cs @@ -42,5 +42,6 @@ public ConfigOut( public ConfigOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.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..c52c813d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOut.g.cs @@ -138,5 +138,6 @@ public ContainerRentalOut( public ContainerRentalOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs index 84c1c7ac..6d34ad29 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalOutFailReason; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalOutFailReason? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOutFailReason; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4726eb7b..63b2969c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutFailReason.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalOutFailReason /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.Json.g.cs index 221bb57b..e6e1463b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalOutIp; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalOutIp? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOutIp; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b70981b0..a4c5683b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutIp.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalOutIp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.Json.g.cs index 09c29c1c..989139cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalOutStopTs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalOutStopTs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalOutStopTs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 123f8075..480cdee7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalOutStopTs.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalOutStopTs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.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..82c1c0e0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartIn.g.cs @@ -78,5 +78,6 @@ public ContainerRentalStartIn( public ContainerRentalStartIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.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..e2d94bba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalStartOut.g.cs @@ -42,5 +42,6 @@ public ContainerRentalStartOut( public ContainerRentalStartOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.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..e1183e0a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalUpdateIn.g.cs @@ -42,5 +42,6 @@ public ContainerRentalUpdateIn( public ContainerRentalUpdateIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.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..6ba679ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteR /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..5a8e560c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey? 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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey? 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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey.g.cs new file mode 100644 index 00000000..3fc05c18 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 629fd26c..37b35e45 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d6848898..89dc3c50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsDeleteV1ContainersContainerIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsDeleteV1ContainersContainerIdDeleteX /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.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..e8fd82d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..44b61bb5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey? 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.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey? 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.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey.g.cs new file mode 100644 index 00000000..d7dc8d20 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 85ea716d..c7083baa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9019f2be..c9b36ca4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetParamsV1ContainersParamsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsGetParamsV1ContainersParamsGetXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..a6c19fb5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ContainerRentalsGetV1ContainersContainerIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ContainerRentalsGetV1ContainersContainerIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXApiKey? 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.ContainerRentalsGetV1ContainersContainerIdGetXApiKey? 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.ContainerRentalsGetV1ContainersContainerIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ContainerRentalsGetV1ContainersContainerIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXApiKey.g.cs new file mode 100644 index 00000000..3f7f93b2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ContainerRentalsGetV1ContainersContainerIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index bde7abd6..9c9323ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 74075bbc..669a1e9d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsGetV1ContainersContainerIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsGetV1ContainersContainerIdGetXiApiKe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXApiKey.Json.g.cs new file mode 100644 index 00000000..f3c20669 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ContainerRentalsListV1ContainersGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ContainerRentalsListV1ContainersGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ContainerRentalsListV1ContainersGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ContainerRentalsListV1ContainersGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsListV1ContainersGetXApiKey? 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.ContainerRentalsListV1ContainersGetXApiKey? 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.ContainerRentalsListV1ContainersGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsListV1ContainersGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ContainerRentalsListV1ContainersGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXApiKey.g.cs new file mode 100644 index 00000000..2ce2b467 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ContainerRentalsListV1ContainersGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs index 28615eba..9c53272a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsListV1ContainersGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsListV1ContainersGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsListV1ContainersGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index cadb3b19..a1cca500 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsListV1ContainersGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsListV1ContainersGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXApiKey.Json.g.cs new file mode 100644 index 00000000..51bf7b26 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ContainerRentalsStartV1ContainersPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ContainerRentalsStartV1ContainersPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ContainerRentalsStartV1ContainersPostXApiKey), + jsonSerializerContext) as global::DeepInfra.ContainerRentalsStartV1ContainersPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsStartV1ContainersPostXApiKey? 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.ContainerRentalsStartV1ContainersPostXApiKey? 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.ContainerRentalsStartV1ContainersPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsStartV1ContainersPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ContainerRentalsStartV1ContainersPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXApiKey.g.cs new file mode 100644 index 00000000..f14ba095 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ContainerRentalsStartV1ContainersPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 8b926fdc..66616a4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsStartV1ContainersPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsStartV1ContainersPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsStartV1ContainersPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 838477fb..18547a9d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsStartV1ContainersPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsStartV1ContainersPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.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..29fd55fa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchRe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey.Json.g.cs new file mode 100644 index 00000000..c5168e84 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey), + jsonSerializerContext) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey? 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.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey? 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.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey.g.cs new file mode 100644 index 00000000..ce1b2bf9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 553a1ea7..d6d8bef1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4c148664..a1d625f0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ContainerRentalsUpdateV1ContainersContainerIdPatchXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ContainerRentalsUpdateV1ContainersContainerIdPatchXi /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXApiKey.Json.g.cs new file mode 100644 index 00000000..c006b3ae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateApiTokenV1ApiTokensPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateApiTokenV1ApiTokensPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateApiTokenV1ApiTokensPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateApiTokenV1ApiTokensPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateApiTokenV1ApiTokensPostXApiKey? 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.CreateApiTokenV1ApiTokensPostXApiKey? 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.CreateApiTokenV1ApiTokensPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateApiTokenV1ApiTokensPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateApiTokenV1ApiTokensPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXApiKey.g.cs new file mode 100644 index 00000000..e4b9a747 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateApiTokenV1ApiTokensPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 1945aa66..4f8876a5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateApiTokenV1ApiTokensPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateApiTokenV1ApiTokensPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateApiTokenV1ApiTokensPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 52ec95f8..b56f40ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateApiTokenV1ApiTokensPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateApiTokenV1ApiTokensPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.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..6b7a2316 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequest.g.cs @@ -79,5 +79,6 @@ public CreateLoraApiRequest( public CreateLoraApiRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs index 0d50af29..9a25e060 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateLoraApiRequestDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateLoraApiRequestDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateLoraApiRequestDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a7347f5f..201448ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraApiRequestDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateLoraApiRequestDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXApiKey.Json.g.cs new file mode 100644 index 00000000..d284970b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateLoraV1LoraCreatePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateLoraV1LoraCreatePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateLoraV1LoraCreatePostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateLoraV1LoraCreatePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateLoraV1LoraCreatePostXApiKey? 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.CreateLoraV1LoraCreatePostXApiKey? 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.CreateLoraV1LoraCreatePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateLoraV1LoraCreatePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateLoraV1LoraCreatePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXApiKey.g.cs new file mode 100644 index 00000000..7178542a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateLoraV1LoraCreatePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 0aa1686f..db783e40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateLoraV1LoraCreatePostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateLoraV1LoraCreatePostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateLoraV1LoraCreatePostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index cd1964c1..e0f607d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateLoraV1LoraCreatePostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateLoraV1LoraCreatePostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXApiKey.Json.g.cs new file mode 100644 index 00000000..04064d9a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateOpenaiBatchV1BatchesPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateOpenaiBatchV1BatchesPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateOpenaiBatchV1BatchesPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateOpenaiBatchV1BatchesPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateOpenaiBatchV1BatchesPostXApiKey? 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.CreateOpenaiBatchV1BatchesPostXApiKey? 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.CreateOpenaiBatchV1BatchesPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateOpenaiBatchV1BatchesPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateOpenaiBatchV1BatchesPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXApiKey.g.cs new file mode 100644 index 00000000..d73cf02e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateOpenaiBatchV1BatchesPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 3656aaeb..0a9551db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateOpenaiBatchV1BatchesPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateOpenaiBatchV1BatchesPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateOpenaiBatchV1BatchesPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 330789d2..3f94668f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1BatchesPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateOpenaiBatchV1BatchesPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.Json.g.cs deleted file mode 100644 index 8fb80c0c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.g.cs deleted file mode 100644 index b880188a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class CreateOpenaiBatchV1OpenaiBatchesPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXApiKey.Json.g.cs new file mode 100644 index 00000000..abf430ed --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateScopedJwtV1ScopedJwtPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateScopedJwtV1ScopedJwtPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXApiKey? 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.CreateScopedJwtV1ScopedJwtPostXApiKey? 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.CreateScopedJwtV1ScopedJwtPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateScopedJwtV1ScopedJwtPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXApiKey.g.cs new file mode 100644 index 00000000..191b4127 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateScopedJwtV1ScopedJwtPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 0a46f128..a86b0ccd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateScopedJwtV1ScopedJwtPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b4e4da5f..d1cbc813 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateScopedJwtV1ScopedJwtPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateScopedJwtV1ScopedJwtPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXApiKey.Json.g.cs new file mode 100644 index 00000000..153eaa6f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateSshKeyV1SshKeysPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateSshKeyV1SshKeysPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateSshKeyV1SshKeysPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateSshKeyV1SshKeysPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateSshKeyV1SshKeysPostXApiKey? 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.CreateSshKeyV1SshKeysPostXApiKey? 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.CreateSshKeyV1SshKeysPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateSshKeyV1SshKeysPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateSshKeyV1SshKeysPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXApiKey.g.cs new file mode 100644 index 00000000..67d4c934 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateSshKeyV1SshKeysPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 07f311e8..5890fc64 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateSshKeyV1SshKeysPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateSshKeyV1SshKeysPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateSshKeyV1SshKeysPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index de7715be..41efcd77 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateSshKeyV1SshKeysPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateSshKeyV1SshKeysPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXApiKey.Json.g.cs new file mode 100644 index 00000000..6ed87597 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateVideoGenerationV1OpenaiVideosPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateVideoGenerationV1OpenaiVideosPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXApiKey? 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.CreateVideoGenerationV1OpenaiVideosPostXApiKey? 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.CreateVideoGenerationV1OpenaiVideosPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateVideoGenerationV1OpenaiVideosPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXApiKey.g.cs new file mode 100644 index 00000000..7bf4cc23 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateVideoGenerationV1OpenaiVideosPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..006db435 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateVideoGenerationV1OpenaiVideosPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateVideoGenerationV1OpenaiVideosPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXiApiKey? 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.CreateVideoGenerationV1OpenaiVideosPostXiApiKey? 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.CreateVideoGenerationV1OpenaiVideosPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVideoGenerationV1OpenaiVideosPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateVideoGenerationV1OpenaiVideosPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXiApiKey.g.cs new file mode 100644 index 00000000..6c2bb6fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1OpenaiVideosPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateVideoGenerationV1OpenaiVideosPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXApiKey.Json.g.cs new file mode 100644 index 00000000..197442df --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateVideoGenerationV1VideosPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateVideoGenerationV1VideosPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateVideoGenerationV1VideosPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateVideoGenerationV1VideosPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateVideoGenerationV1VideosPostXApiKey? 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.CreateVideoGenerationV1VideosPostXApiKey? 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.CreateVideoGenerationV1VideosPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVideoGenerationV1VideosPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateVideoGenerationV1VideosPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXApiKey.g.cs new file mode 100644 index 00000000..846f7113 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateVideoGenerationV1VideosPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..3e6a1e21 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateVideoGenerationV1VideosPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateVideoGenerationV1VideosPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateVideoGenerationV1VideosPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.CreateVideoGenerationV1VideosPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateVideoGenerationV1VideosPostXiApiKey? 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.CreateVideoGenerationV1VideosPostXiApiKey? 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.CreateVideoGenerationV1VideosPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVideoGenerationV1VideosPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateVideoGenerationV1VideosPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXiApiKey.g.cs new file mode 100644 index 00000000..c6edf1b1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVideoGenerationV1VideosPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateVideoGenerationV1VideosPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXApiKey.Json.g.cs new file mode 100644 index 00000000..bc440e8e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class CreateVoiceV1VoicesAddPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.CreateVoiceV1VoicesAddPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.CreateVoiceV1VoicesAddPostXApiKey), + jsonSerializerContext) as global::DeepInfra.CreateVoiceV1VoicesAddPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateVoiceV1VoicesAddPostXApiKey? 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.CreateVoiceV1VoicesAddPostXApiKey? 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.CreateVoiceV1VoicesAddPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVoiceV1VoicesAddPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.CreateVoiceV1VoicesAddPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXApiKey.g.cs new file mode 100644 index 00000000..4a067ec3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class CreateVoiceV1VoicesAddPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 3aa5b8be..98194a9b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.CreateVoiceV1VoicesAddPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.CreateVoiceV1VoicesAddPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.CreateVoiceV1VoicesAddPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 600643f6..89acb12f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.CreateVoiceV1VoicesAddPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class CreateVoiceV1VoicesAddPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.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..cbe006e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepError.g.cs @@ -42,5 +42,6 @@ public DeepError( public DeepError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.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..482524d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.cs @@ -127,5 +127,6 @@ public DeepStartApplicationIn( public DeepStartApplicationIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs index 6c3b7cb3..c22b7f69 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationInDeal; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationInDeal? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationInDeal; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4dcb93a7..c3fbf1bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationInDeal /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs index 29e9287d..4f9416be 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationInUid; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationInUid? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationInUid; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b77c6532..4e4dc167 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationInUid /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.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..e02469a6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.cs @@ -136,5 +136,6 @@ public DeepStartApplicationOut( public DeepStartApplicationOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs index 96b94f4c..7761fa8b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOutDeal; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationOutDeal? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOutDeal; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 694f7e00..144cfcc2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationOutDeal /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs index 3e1a957e..6d3ea26b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOutEmail; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationOutEmail? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOutEmail; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d97c4fc9..de1d17f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationOutEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs index cf071a8e..71cfaee4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeepStartApplicationOutUid; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeepStartApplicationOutUid? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeepStartApplicationOutUid; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2619412d..80cf2530 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepStartApplicationOutUid /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.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..604a6ff2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeepstartApplyPaymentDeepstartApplicationPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..e2063535 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteAccountV1MeDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteAccountV1MeDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteAccountV1MeDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteAccountV1MeDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteAccountV1MeDeleteXApiKey? 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.DeleteAccountV1MeDeleteXApiKey? 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.DeleteAccountV1MeDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteAccountV1MeDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteAccountV1MeDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXApiKey.g.cs new file mode 100644 index 00000000..e4746c00 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteAccountV1MeDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 05970de7..1119b6b5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteAccountV1MeDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteAccountV1MeDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteAccountV1MeDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0cf20c76..6c08861d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteAccountV1MeDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteAccountV1MeDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.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..8ee458d8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..0834b072 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey? 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.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey? 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.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey.g.cs new file mode 100644 index 00000000..a0e69d78 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index e48cd827..4ac08148 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 67c82c60..752c330f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteApiTokenV1ApiTokensApiTokenDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..3e27c7bd --- /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.DeleteFileV1FilesFileIdDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..67994fb9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteFileV1FilesFileIdDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteFileV1FilesFileIdDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteFileV1FilesFileIdDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteFileV1FilesFileIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteFileV1FilesFileIdDeleteXApiKey? 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.DeleteFileV1FilesFileIdDeleteXApiKey? 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.DeleteFileV1FilesFileIdDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteFileV1FilesFileIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteFileV1FilesFileIdDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXApiKey.g.cs new file mode 100644 index 00000000..358d7951 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteFileV1FilesFileIdDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXiApiKey.Json.g.cs new file mode 100644 index 00000000..fe3e0395 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteFileV1FilesFileIdDeleteXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteFileV1FilesFileIdDeleteXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteFileV1FilesFileIdDeleteXiApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteFileV1FilesFileIdDeleteXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteFileV1FilesFileIdDeleteXiApiKey? 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.DeleteFileV1FilesFileIdDeleteXiApiKey? 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.DeleteFileV1FilesFileIdDeleteXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteFileV1FilesFileIdDeleteXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteFileV1FilesFileIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXiApiKey.g.cs new file mode 100644 index 00000000..594747a3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteFileV1FilesFileIdDeleteXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteFileV1FilesFileIdDeleteXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..9ce44fda 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..ded90d8e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey? 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.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey? 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.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey.g.cs new file mode 100644 index 00000000..519ef0e8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index a56eb257..07797b88 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c67d70d8..16e0b163 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraModelLoraModelLoraModelNameDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.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..f5c6edaa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraV1LoraLoraNameDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..f8271eb5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteLoraV1LoraLoraNameDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteLoraV1LoraLoraNameDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXApiKey? 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.DeleteLoraV1LoraLoraNameDeleteXApiKey? 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.DeleteLoraV1LoraLoraNameDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteLoraV1LoraLoraNameDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXApiKey.g.cs new file mode 100644 index 00000000..c4f36ddb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteLoraV1LoraLoraNameDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 96be9ba8..bf0ebc07 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteLoraV1LoraLoraNameDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 548a55d9..0973840c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteLoraV1LoraLoraNameDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteLoraV1LoraLoraNameDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.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..20f8f3b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..2706a39a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey? 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey? 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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey.g.cs new file mode 100644 index 00000000..94caa39f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index c6e057e4..64a40b62 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e5958d5a..c5cc048c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteSshKeyV1SshKeysSshKeyIdDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.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..1de5ecad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..72dd8428 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey? 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.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey? 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.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey.g.cs new file mode 100644 index 00000000..801e9e99 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 538d67b5..26107ead 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index bf5abcb2..97b8fc81 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeleteVoiceV1VoicesVoiceIdDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXApiKey.Json.g.cs new file mode 100644 index 00000000..42a607be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployCreateHfDeployHfPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployCreateHfDeployHfPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployCreateHfDeployHfPostXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployCreateHfDeployHfPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployCreateHfDeployHfPostXApiKey? 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.DeployCreateHfDeployHfPostXApiKey? 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.DeployCreateHfDeployHfPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateHfDeployHfPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployCreateHfDeployHfPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXApiKey.g.cs new file mode 100644 index 00000000..b03f4bce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployCreateHfDeployHfPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index ba041c4d..ddbefb44 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployCreateHfDeployHfPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployCreateHfDeployHfPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateHfDeployHfPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b762f323..7660ca1c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateHfDeployHfPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployCreateHfDeployHfPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXApiKey.Json.g.cs new file mode 100644 index 00000000..3d3f4c01 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployCreateLlmDeployLlmPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployCreateLlmDeployLlmPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployCreateLlmDeployLlmPostXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployCreateLlmDeployLlmPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployCreateLlmDeployLlmPostXApiKey? 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.DeployCreateLlmDeployLlmPostXApiKey? 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.DeployCreateLlmDeployLlmPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateLlmDeployLlmPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployCreateLlmDeployLlmPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXApiKey.g.cs new file mode 100644 index 00000000..3547f7bb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployCreateLlmDeployLlmPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 2f40f8ad..3ea20690 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployCreateLlmDeployLlmPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployCreateLlmDeployLlmPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateLlmDeployLlmPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c757eb36..8e489382 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateLlmDeployLlmPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployCreateLlmDeployLlmPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXApiKey.Json.g.cs new file mode 100644 index 00000000..29a87c6f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployCreateV1DeployPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployCreateV1DeployPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployCreateV1DeployPostXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployCreateV1DeployPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployCreateV1DeployPostXApiKey? 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.DeployCreateV1DeployPostXApiKey? 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.DeployCreateV1DeployPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateV1DeployPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployCreateV1DeployPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXApiKey.g.cs new file mode 100644 index 00000000..e84c4a96 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployCreateV1DeployPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 0180b393..8e8c8152 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployCreateV1DeployPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployCreateV1DeployPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployCreateV1DeployPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index eeeaa48a..7424b00b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployCreateV1DeployPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployCreateV1DeployPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.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..f90adafe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDelete.g.cs @@ -42,5 +42,6 @@ public DeployDelete( public DeployDelete() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..8f6bbc12 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployDeleteDeployDeployIdDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployDeleteDeployDeployIdDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployDeleteDeployDeployIdDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployDeleteDeployDeployIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployDeleteDeployDeployIdDeleteXApiKey? 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.DeployDeleteDeployDeployIdDeleteXApiKey? 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.DeployDeleteDeployDeployIdDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDeleteDeployDeployIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployDeleteDeployDeployIdDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXApiKey.g.cs new file mode 100644 index 00000000..2ef45d44 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployDeleteDeployDeployIdDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index 752dd358..757cf593 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployDeleteDeployDeployIdDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployDeleteDeployDeployIdDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDeleteDeployDeployIdDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8eb4d038..4fb5d76b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDeleteDeployDeployIdDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployDeleteDeployDeployIdDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXApiKey.Json.g.cs new file mode 100644 index 00000000..e29e025b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployDetailedStatsDeployDeployIdStats2GetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployDetailedStatsDeployDeployIdStats2GetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXApiKey? 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.DeployDetailedStatsDeployDeployIdStats2GetXApiKey? 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.DeployDetailedStatsDeployDeployIdStats2GetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployDetailedStatsDeployDeployIdStats2GetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXApiKey.g.cs new file mode 100644 index 00000000..9acc4c30 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployDetailedStatsDeployDeployIdStats2GetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 9f1c97bb..c5ccd0c1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2b1cf707..73f2c9a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployDetailedStatsDeployDeployIdStats2GetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployDetailedStatsDeployDeployIdStats2GetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.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..c8ac50ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGPUAvailability.g.cs @@ -42,5 +42,6 @@ public DeployGPUAvailability( public DeployGPUAvailability() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey.Json.g.cs new file mode 100644 index 00000000..f560dc92 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey? 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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey? 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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey.g.cs new file mode 100644 index 00000000..7c6be442 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs index 56d5e6d4..6a9e2106 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ae38fd34..3a1920b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployGpuAvailabilityDeployLlmGpuAvailabilityGetXiAp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.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..fcad7b53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployInstances.g.cs @@ -50,5 +50,6 @@ public DeployInstances( public DeployInstances() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.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..3ccc1046 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfig.g.cs @@ -78,5 +78,6 @@ public DeployLLMConfig( public DeployLLMConfig() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMConfigWeights.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..8325fe50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMIn.g.cs @@ -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))] @@ -67,6 +67,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. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + public global::DeepInfra.StandardArgs? StandardArgs { get; set; } + + /// + /// Apply a DeepInfra preset (base_model deploys only). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("preset_id")] + public string? PresetId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -80,7 +92,7 @@ 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
@@ -101,6 +113,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. + /// + /// + /// Apply a DeepInfra preset (base_model deploys only). + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -113,7 +131,9 @@ public DeployLLMIn( 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; @@ -124,6 +144,8 @@ public DeployLLMIn( this.ContainerImage = containerImage; this.Settings = settings; this.ExtraArgs = extraArgs; + this.StandardArgs = standardArgs; + this.PresetId = presetId; } /// @@ -132,5 +154,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 index fc3d9189..1d4cc251 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMInBaseModel; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInBaseModel? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInBaseModel; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a78344b6..71b51773 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInBaseModel.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInBaseModel /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.Json.g.cs index 60fcbfd8..9766771a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMInContainerImage; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInContainerImage? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInContainerImage; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 47e596e5..2eaad5f7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInContainerImage.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInContainerImage /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.Json.g.cs index 47cba468..e6cc6368 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployLLMInExtraArgs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInExtraArgs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInExtraArgs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 25800eac..49dedd4d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInExtraArgs.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInExtraArgs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.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..f7aef21a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInHf.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInHf /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInPresetId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInPresetId.Json.g.cs new file mode 100644 index 00000000..9d45846f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInPresetId.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLLMInPresetId + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLLMInPresetId? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLLMInPresetId), + jsonSerializerContext) as global::DeepInfra.DeployLLMInPresetId; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMInPresetId? 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.DeployLLMInPresetId? 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.DeployLLMInPresetId), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMInPresetId; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLLMInPresetId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInPresetId.g.cs new file mode 100644 index 00000000..19e6f3a4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInPresetId.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Apply a DeepInfra preset (base_model deploys only). + /// + public sealed partial class DeployLLMInPresetId + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..adcf3dcb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMInSettings.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployLLMInSettings /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..a16b75d3 --- /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. + /// + 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..4f46374e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateIn.g.cs @@ -12,8 +12,19 @@ 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.DeployLLMUpdateInExtraArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInExtraArgs.Json.g.cs new file mode 100644 index 00000000..ee9aea1c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInExtraArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLLMUpdateInExtraArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLLMUpdateInExtraArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLLMUpdateInExtraArgs), + jsonSerializerContext) as global::DeepInfra.DeployLLMUpdateInExtraArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLLMUpdateInExtraArgs? 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.DeployLLMUpdateInExtraArgs? 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.DeployLLMUpdateInExtraArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLLMUpdateInExtraArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLLMUpdateInExtraArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInExtraArgs.g.cs new file mode 100644 index 00000000..8210385e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLLMUpdateInExtraArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Extra engine-specific command-line args (custom-weight deploys only). Replaces the whole list; omitted args are cleared. + /// + public sealed partial class DeployLLMUpdateInExtraArgs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..dd3fd382 --- /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 index 0cfcaaf5..b91fcc16 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetStatus; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployListDeployListGetStatus? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetStatus; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a1d1b3ea..443d1615 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetStatus /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.Json.g.cs index 47f3d63f..add0bfaf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetStatus2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployListDeployListGetStatus2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetStatus2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4462e019..92ade622 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetStatus2.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetStatus2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey.Json.g.cs new file mode 100644 index 00000000..d698eaa9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployListDeployListGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployListDeployListGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployListDeployListGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployListDeployListGetXApiKey? 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.DeployListDeployListGetXApiKey? 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.DeployListDeployListGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployListDeployListGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey.g.cs new file mode 100644 index 00000000..1a01cfa2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployListDeployListGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey2.Json.g.cs new file mode 100644 index 00000000..178d8cc6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployListDeployListGetXApiKey2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployListDeployListGetXApiKey2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployListDeployListGetXApiKey2), + jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetXApiKey2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployListDeployListGetXApiKey2? 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.DeployListDeployListGetXApiKey2? 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.DeployListDeployListGetXApiKey2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetXApiKey2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployListDeployListGetXApiKey2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey2.g.cs new file mode 100644 index 00000000..b3b56a83 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXApiKey2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployListDeployListGetXApiKey2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 083a3b14..34612498 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployListDeployListGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c7cb6295..6db9c2dc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.Json.g.cs index a30bd9d7..7bc914ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployListDeployListGetXiApiKey2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployListDeployListGetXiApiKey2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployListDeployListGetXiApiKey2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ffcecc2b..d02477ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployListDeployListGetXiApiKey2.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployListDeployListGetXiApiKey2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetEngine.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetEngine.Json.g.cs new file mode 100644 index 00000000..5b29b544 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetEngine.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetEngine + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmPresetsDeployLlmPresetsGetEngine? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetEngine), + jsonSerializerContext) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetEngine; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetEngine? 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.DeployLlmPresetsDeployLlmPresetsGetEngine? 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.DeployLlmPresetsDeployLlmPresetsGetEngine), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetEngine; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmPresetsDeployLlmPresetsGetEngine.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetEngine.g.cs new file mode 100644 index 00000000..8456d8c3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetEngine.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetEngine + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetGpu.Json.g.cs new file mode 100644 index 00000000..e5885917 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetGpu.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetGpu + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmPresetsDeployLlmPresetsGetGpu? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetGpu), + jsonSerializerContext) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetGpu; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetGpu? 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.DeployLlmPresetsDeployLlmPresetsGetGpu? 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.DeployLlmPresetsDeployLlmPresetsGetGpu), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetGpu; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmPresetsDeployLlmPresetsGetGpu.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetGpu.g.cs new file mode 100644 index 00000000..9a1707ad --- /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.DeployLlmPresetsDeployLlmPresetsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..f5b8bdfa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmPresetsDeployLlmPresetsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXApiKey? 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.DeployLlmPresetsDeployLlmPresetsGetXApiKey? 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.DeployLlmPresetsDeployLlmPresetsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmPresetsDeployLlmPresetsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXApiKey.g.cs new file mode 100644 index 00000000..d6307e0b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..791a8a55 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmPresetsDeployLlmPresetsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXiApiKey? 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.DeployLlmPresetsDeployLlmPresetsGetXiApiKey? 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.DeployLlmPresetsDeployLlmPresetsGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmPresetsDeployLlmPresetsGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmPresetsDeployLlmPresetsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXiApiKey.g.cs new file mode 100644 index 00000000..abf91ad4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmPresetsDeployLlmPresetsGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmPresetsDeployLlmPresetsGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..0cf15dbf --- /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.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..4da4af51 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey? 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.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey? 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.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey.g.cs new file mode 100644 index 00000000..b4b2c522 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmStandardArgsDeployLlmStandardArgsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..540ea7bd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey? 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.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey? 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.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey.g.cs new file mode 100644 index 00000000..3e69eb5b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmStandardArgsDeployLlmStandardArgsGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey.Json.g.cs new file mode 100644 index 00000000..cf2b287d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey? 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.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey? 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.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey.g.cs new file mode 100644 index 00000000..8588258a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmSuggestNameDeployLlmSuggestNameGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..8f9689cc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey? 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.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey? 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.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.g.cs new file mode 100644 index 00000000..430d4547 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployLlmSuggestNameDeployLlmSuggestNameGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.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..b36b2e5f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelIn.g.cs @@ -67,5 +67,6 @@ public DeployModelIn( public DeployModelIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs index 9141c311..72697f6d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployModelInVersion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployModelInVersion? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployModelInVersion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4d6373b4..ff4debf1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployModelInVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployModelInVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.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..cb730d95 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployResult.g.cs @@ -42,5 +42,6 @@ public DeployResult( public DeployResult() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXApiKey.Json.g.cs new file mode 100644 index 00000000..a494de39 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployStartDeployDeployIdStartPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployStartDeployDeployIdStartPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployStartDeployDeployIdStartPostXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployStartDeployDeployIdStartPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStartDeployDeployIdStartPostXApiKey? 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.DeployStartDeployDeployIdStartPostXApiKey? 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.DeployStartDeployDeployIdStartPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStartDeployDeployIdStartPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployStartDeployDeployIdStartPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXApiKey.g.cs new file mode 100644 index 00000000..f2bd01eb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployStartDeployDeployIdStartPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index 56142a9d..4dae51ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployStartDeployDeployIdStartPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStartDeployDeployIdStartPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStartDeployDeployIdStartPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0db29134..87c0190d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStartDeployDeployIdStartPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStartDeployDeployIdStartPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..be177b06 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployStatsDeployDeployIdStatsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployStatsDeployDeployIdStatsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployStatsDeployDeployIdStatsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployStatsDeployDeployIdStatsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStatsDeployDeployIdStatsGetXApiKey? 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.DeployStatsDeployDeployIdStatsGetXApiKey? 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.DeployStatsDeployDeployIdStatsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatsDeployDeployIdStatsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployStatsDeployDeployIdStatsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXApiKey.g.cs new file mode 100644 index 00000000..b5a2d0bd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployStatsDeployDeployIdStatsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 4c0bf854..adcdff57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployStatsDeployDeployIdStatsGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStatsDeployDeployIdStatsGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatsDeployDeployIdStatsGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index aea696c3..d2df8be6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatsDeployDeployIdStatsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStatsDeployDeployIdStatsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..f520c38a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployStatusDeployDeployIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployStatusDeployDeployIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployStatusDeployDeployIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployStatusDeployDeployIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStatusDeployDeployIdGetXApiKey? 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.DeployStatusDeployDeployIdGetXApiKey? 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.DeployStatusDeployDeployIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatusDeployDeployIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployStatusDeployDeployIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXApiKey.g.cs new file mode 100644 index 00000000..29650ae5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployStatusDeployDeployIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 6aec5120..c10e4e5d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployStatusDeployDeployIdGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStatusDeployDeployIdGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStatusDeployDeployIdGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b3214252..6ed69478 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusDeployDeployIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStatusDeployDeployIdGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.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..dcaa6168 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStatusOut.g.cs @@ -42,5 +42,6 @@ public DeployStatusOut( public DeployStatusOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXApiKey.Json.g.cs new file mode 100644 index 00000000..bd2b6fb0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployStopDeployDeployIdStopPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployStopDeployDeployIdStopPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployStopDeployDeployIdStopPostXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployStopDeployDeployIdStopPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStopDeployDeployIdStopPostXApiKey? 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.DeployStopDeployDeployIdStopPostXApiKey? 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.DeployStopDeployDeployIdStopPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStopDeployDeployIdStopPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployStopDeployDeployIdStopPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXApiKey.g.cs new file mode 100644 index 00000000..f3597224 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployStopDeployDeployIdStopPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index 858ff0d6..c95541f9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployStopDeployDeployIdStopPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployStopDeployDeployIdStopPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployStopDeployDeployIdStopPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7d50f87e..b7a92da5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployStopDeployDeployIdStopPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployStopDeployDeployIdStopPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXApiKey.Json.g.cs new file mode 100644 index 00000000..47a47772 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeployUpdateDeployDeployIdPutXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeployUpdateDeployDeployIdPutXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeployUpdateDeployDeployIdPutXApiKey), + jsonSerializerContext) as global::DeepInfra.DeployUpdateDeployDeployIdPutXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployUpdateDeployDeployIdPutXApiKey? 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.DeployUpdateDeployDeployIdPutXApiKey? 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.DeployUpdateDeployDeployIdPutXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployUpdateDeployDeployIdPutXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeployUpdateDeployDeployIdPutXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXApiKey.g.cs new file mode 100644 index 00000000..259d281b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeployUpdateDeployDeployIdPutXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs index d2a00afe..c47ad1d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeployUpdateDeployDeployIdPutXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeployUpdateDeployDeployIdPutXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeployUpdateDeployDeployIdPutXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3375f154..d8c984ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeployUpdateDeployDeployIdPutXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeployUpdateDeployDeployIdPutXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.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..7ed03c57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOut.g.cs @@ -12,7 +12,7 @@ public sealed partial class DeploymentLogQueryOut /// mapping of pod names to log lines ordered by increasing timestamp /// [global::System.Text.Json.Serialization.JsonPropertyName("entries")] - public global::System.Collections.Generic.Dictionary>? Entries { get; set; } + public global::System.Collections.Generic.Dictionary>>? Entries { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -30,7 +30,7 @@ public sealed partial class DeploymentLogQueryOut [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public DeploymentLogQueryOut( - global::System.Collections.Generic.Dictionary>? entries) + global::System.Collections.Generic.Dictionary>>? entries) { this.Entries = entries; } @@ -41,5 +41,6 @@ public DeploymentLogQueryOut( public DeploymentLogQueryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogQueryOutEntries.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 index 55951915..a9b68e45 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 14cefcbf..06af47ef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetFrom.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetFrom /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs index ea05ba53..2f4733c9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d15081e1..e59ed00f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetPodName.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetPodName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs index 5d1c24fc..93700230 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetTo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetTo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetTo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2516b034..16190bd6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey.Json.g.cs new file mode 100644 index 00000000..8f47644c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey? 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey? 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.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey.g.cs new file mode 100644 index 00000000..c3fc2056 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 4497f659..c302e9f2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0264d8c1..f3aa8688 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentLogsQueryV1DeploymentLogsQueryGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.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..1885d5b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentMainStatsOut.g.cs @@ -54,5 +54,6 @@ public DeploymentMainStatsOut( public DeploymentMainStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.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..bbbcc4fb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOut.g.cs @@ -89,6 +89,18 @@ 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 object? 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; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -134,6 +146,12 @@ public sealed partial class DeploymentOut /// /// Scale Settings /// + /// + /// Current engine tuning knobs + /// + /// + /// Current extra engine-specific command-line args (custom-weight deploys only) + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -149,7 +167,9 @@ public DeploymentOut( global::DeepInfra.DeployType? type, global::DeepInfra.DeployInstances? instances, global::DeepInfra.DeployLLMConfig? config, - global::DeepInfra.ScaleSettings? settings) + global::DeepInfra.ScaleSettings? settings, + object? standardArgs, + global::System.Collections.Generic.IList? extraArgs) { this.Type = type; this.DeployId = deployId ?? throw new global::System.ArgumentNullException(nameof(deployId)); @@ -163,6 +183,8 @@ public DeploymentOut( this.Instances = instances; this.Config = config; this.Settings = settings; + this.StandardArgs = standardArgs; + this.ExtraArgs = extraArgs; } /// @@ -171,5 +193,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.DeploymentOutExtraArgs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutExtraArgs.Json.g.cs new file mode 100644 index 00000000..4753bf32 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutExtraArgs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeploymentOutExtraArgs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeploymentOutExtraArgs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeploymentOutExtraArgs), + jsonSerializerContext) as global::DeepInfra.DeploymentOutExtraArgs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutExtraArgs? 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.DeploymentOutExtraArgs? 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.DeploymentOutExtraArgs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutExtraArgs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeploymentOutExtraArgs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutExtraArgs.g.cs new file mode 100644 index 00000000..553d1573 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutExtraArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Current extra engine-specific command-line args (custom-weight deploys only) + /// + public sealed partial class DeploymentOutExtraArgs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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.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..5066c4c2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Current engine tuning knobs + /// + public sealed partial class DeploymentOutStandardArgs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs2.Json.g.cs new file mode 100644 index 00000000..3c88e425 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeploymentOutStandardArgs2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeploymentOutStandardArgs2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeploymentOutStandardArgs2), + jsonSerializerContext) as global::DeepInfra.DeploymentOutStandardArgs2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentOutStandardArgs2? 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.DeploymentOutStandardArgs2? 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.DeploymentOutStandardArgs2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentOutStandardArgs2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeploymentOutStandardArgs2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs2.g.cs new file mode 100644 index 00000000..1b1e0c3e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentOutStandardArgs2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeploymentOutStandardArgs2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..8a8ba475 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DeploymentStatsDeployStatsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DeploymentStatsDeployStatsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DeploymentStatsDeployStatsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.DeploymentStatsDeployStatsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentStatsDeployStatsGetXApiKey? 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.DeploymentStatsDeployStatsGetXApiKey? 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.DeploymentStatsDeployStatsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentStatsDeployStatsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DeploymentStatsDeployStatsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXApiKey.g.cs new file mode 100644 index 00000000..ce0671c0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DeploymentStatsDeployStatsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs index fcda0ac1..eceaacb7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DeploymentStatsDeployStatsGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DeploymentStatsDeployStatsGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DeploymentStatsDeployStatsGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 38954a2e..7b766fe8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsDeployStatsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class DeploymentStatsDeployStatsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.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..c596be1a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DeploymentStatsOut.g.cs @@ -138,5 +138,6 @@ public DeploymentStatsOut( public DeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.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..fdb52e13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOut.g.cs @@ -63,5 +63,6 @@ public DetailedDeploymentStatsOut( public DetailedDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetailedDeploymentStatsOutEmbeddings.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..08a34c12 --- /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..e92ba8af --- /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.DetokenizeV1DetokenizePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXApiKey.Json.g.cs new file mode 100644 index 00000000..ac591842 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DetokenizeV1DetokenizePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DetokenizeV1DetokenizePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DetokenizeV1DetokenizePostXApiKey), + jsonSerializerContext) as global::DeepInfra.DetokenizeV1DetokenizePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetokenizeV1DetokenizePostXApiKey? 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.DetokenizeV1DetokenizePostXApiKey? 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.DetokenizeV1DetokenizePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetokenizeV1DetokenizePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DetokenizeV1DetokenizePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXApiKey.g.cs new file mode 100644 index 00000000..2a916670 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DetokenizeV1DetokenizePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXiApiKey.Json.g.cs new file mode 100644 index 00000000..19a5663d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class DetokenizeV1DetokenizePostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.DetokenizeV1DetokenizePostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.DetokenizeV1DetokenizePostXiApiKey), + jsonSerializerContext) as global::DeepInfra.DetokenizeV1DetokenizePostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DetokenizeV1DetokenizePostXiApiKey? 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.DetokenizeV1DetokenizePostXiApiKey? 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.DetokenizeV1DetokenizePostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DetokenizeV1DetokenizePostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.DetokenizeV1DetokenizePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXiApiKey.g.cs new file mode 100644 index 00000000..c0115bdc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DetokenizeV1DetokenizePostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class DetokenizeV1DetokenizePostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.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..8ba43702 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.cs @@ -51,5 +51,6 @@ public DiscountMeta( public DiscountMeta() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs index 89f95a59..f7d7bc9d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.DiscountMetaDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.DiscountMetaDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.DiscountMetaDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 15a36059..3ec31f56 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class DiscountMetaDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.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..a6f6fac7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.DisplayNameIn.g.cs @@ -42,5 +42,6 @@ public DisplayNameIn( public DisplayNameIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.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..42ef24b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechIn.g.cs @@ -80,5 +80,6 @@ public ElevenLabsTextToSpeechIn( public ElevenLabsTextToSpeechIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs index 16af02b4..76d075e4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ElevenLabsTextToSpeechInLanguageCode; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ElevenLabsTextToSpeechInLanguageCode? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ElevenLabsTextToSpeechInLanguageCode; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 24743f81..a8b77e6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ElevenLabsTextToSpeechInLanguageCode.g.cs @@ -14,5 +14,6 @@ public sealed partial class ElevenLabsTextToSpeechInLanguageCode /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.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..2cf74744 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmailsOut.g.cs @@ -42,5 +42,6 @@ public EmailsOut( public EmailsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.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..ab573374 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.EmbeddingsDeploymentStatsOut.g.cs @@ -102,5 +102,6 @@ public EmbeddingsDeploymentStatsOut( public EmbeddingsDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.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..e2bf43e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExpor /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey.Json.g.cs new file mode 100644 index 00000000..f2497652 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey), + jsonSerializerContext) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey? 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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey? 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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey.g.cs new file mode 100644 index 00000000..23b1d448 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index d2a5013d..126e9da8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 06717c23..5366433d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ExportApiTokenToVercelV1ApiTokensApiTokenVercelExportPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ExportApiTokenToVercelV1ApiTokensApiTokenVercelExpor /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.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..8f00fbc3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FAQEntryOut.g.cs @@ -79,5 +79,6 @@ public FAQEntryOut( public FAQEntryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.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..758b5069 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackIn.g.cs @@ -53,5 +53,6 @@ public FeedbackIn( public FeedbackIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs index 891d8a77..65eb7cd2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FeedbackInContactEmail; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FeedbackInContactEmail? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FeedbackInContactEmail; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7d199dee..f7e15f67 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FeedbackInContactEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class FeedbackInContactEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.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..bb5d70e1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Function.g.cs @@ -54,5 +54,6 @@ public Function( public Function() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.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..d1ca7efd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinition.g.cs @@ -58,5 +58,6 @@ public FunctionDefinition( public FunctionDefinition() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs index 6c700f30..251ac5ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.FunctionDefinitionDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.FunctionDefinitionDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.FunctionDefinitionDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8c8e6af2..930e44e6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class FunctionDefinitionDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.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..55cda535 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters.g.cs @@ -14,5 +14,6 @@ public sealed partial class FunctionDefinitionParameters /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.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..c13780f2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.FunctionDefinitionParameters2.g.cs @@ -14,5 +14,6 @@ public sealed partial class FunctionDefinitionParameters2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.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..d6c5a465 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GPUAvailabilityInfo.g.cs @@ -71,5 +71,6 @@ public GPUAvailabilityInfo( public GPUAvailabilityInfo() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXApiKey.Json.g.cs new file mode 100644 index 00000000..beca726b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetApiTokenV1ApiTokensApiTokenGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetApiTokenV1ApiTokensApiTokenGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXApiKey? 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.GetApiTokenV1ApiTokensApiTokenGetXApiKey? 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.GetApiTokenV1ApiTokensApiTokenGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetApiTokenV1ApiTokensApiTokenGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXApiKey.g.cs new file mode 100644 index 00000000..cc057f50 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetApiTokenV1ApiTokensApiTokenGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index 9f52ef1f..80b51df4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetApiTokenV1ApiTokensApiTokenGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9489f8a2..f6ae3723 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokenV1ApiTokensApiTokenGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetApiTokenV1ApiTokensApiTokenGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXApiKey.Json.g.cs new file mode 100644 index 00000000..444fb4dc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetApiTokensV1ApiTokensGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetApiTokensV1ApiTokensGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetApiTokensV1ApiTokensGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetApiTokensV1ApiTokensGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetApiTokensV1ApiTokensGetXApiKey? 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.GetApiTokensV1ApiTokensGetXApiKey? 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.GetApiTokensV1ApiTokensGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetApiTokensV1ApiTokensGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetApiTokensV1ApiTokensGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXApiKey.g.cs new file mode 100644 index 00000000..ff339aa5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetApiTokensV1ApiTokensGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index f631b0f1..7e41c825 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetApiTokensV1ApiTokensGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetApiTokensV1ApiTokensGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetApiTokensV1ApiTokensGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0e59736f..508ae085 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetApiTokensV1ApiTokensGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetApiTokensV1ApiTokensGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.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..598c6cac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetChecklistPaymentChecklistGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.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..b3fc43a3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetConfigPaymentConfigGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..3ba6322b --- /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.GetFileContentV1FilesFileIdContentGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXApiKey.Json.g.cs new file mode 100644 index 00000000..9d154eb7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetFileContentV1FilesFileIdContentGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetFileContentV1FilesFileIdContentGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetFileContentV1FilesFileIdContentGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetFileContentV1FilesFileIdContentGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetFileContentV1FilesFileIdContentGetXApiKey? 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.GetFileContentV1FilesFileIdContentGetXApiKey? 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.GetFileContentV1FilesFileIdContentGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetFileContentV1FilesFileIdContentGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetFileContentV1FilesFileIdContentGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXApiKey.g.cs new file mode 100644 index 00000000..4aafa72c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetFileContentV1FilesFileIdContentGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..b8ee6118 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetFileContentV1FilesFileIdContentGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetFileContentV1FilesFileIdContentGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetFileContentV1FilesFileIdContentGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.GetFileContentV1FilesFileIdContentGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetFileContentV1FilesFileIdContentGetXiApiKey? 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.GetFileContentV1FilesFileIdContentGetXiApiKey? 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.GetFileContentV1FilesFileIdContentGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetFileContentV1FilesFileIdContentGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetFileContentV1FilesFileIdContentGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXiApiKey.g.cs new file mode 100644 index 00000000..40ea0ae4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileContentV1FilesFileIdContentGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetFileContentV1FilesFileIdContentGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..78b8386c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetFileV1FilesFileIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetFileV1FilesFileIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetFileV1FilesFileIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetFileV1FilesFileIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetFileV1FilesFileIdGetXApiKey? 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.GetFileV1FilesFileIdGetXApiKey? 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.GetFileV1FilesFileIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetFileV1FilesFileIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetFileV1FilesFileIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXApiKey.g.cs new file mode 100644 index 00000000..4aca059c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetFileV1FilesFileIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..f43af252 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetFileV1FilesFileIdGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetFileV1FilesFileIdGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetFileV1FilesFileIdGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.GetFileV1FilesFileIdGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetFileV1FilesFileIdGetXiApiKey? 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.GetFileV1FilesFileIdGetXiApiKey? 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.GetFileV1FilesFileIdGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetFileV1FilesFileIdGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetFileV1FilesFileIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXiApiKey.g.cs new file mode 100644 index 00000000..8123c82e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetFileV1FilesFileIdGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetFileV1FilesFileIdGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXApiKey.Json.g.cs new file mode 100644 index 00000000..c7eff470 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetHardwareV2HardwareGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetHardwareV2HardwareGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetHardwareV2HardwareGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetHardwareV2HardwareGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetHardwareV2HardwareGetXApiKey? 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.GetHardwareV2HardwareGetXApiKey? 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.GetHardwareV2HardwareGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetHardwareV2HardwareGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetHardwareV2HardwareGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXApiKey.g.cs new file mode 100644 index 00000000..2aee3ee3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetHardwareV2HardwareGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index cb34975e..f032d2d2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetHardwareV2HardwareGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetHardwareV2HardwareGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetHardwareV2HardwareGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a9c32ad5..f54b989f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetHardwareV2HardwareGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetHardwareV2HardwareGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.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..81db7178 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXApiKey.Json.g.cs new file mode 100644 index 00000000..91570c65 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetLoraStatusV1LoraLoraNameStatusGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXApiKey? 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.GetLoraStatusV1LoraLoraNameStatusGetXApiKey? 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.GetLoraStatusV1LoraLoraNameStatusGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetLoraStatusV1LoraLoraNameStatusGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXApiKey.g.cs new file mode 100644 index 00000000..5a01ceb4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 7e382c06..7811cf1c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 61b95933..aa2ec160 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraStatusV1LoraLoraNameStatusGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraStatusV1LoraLoraNameStatusGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.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..a2216619 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraV1LoraLoraNameGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXApiKey.Json.g.cs new file mode 100644 index 00000000..ec0dc847 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetLoraV1LoraLoraNameGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetLoraV1LoraLoraNameGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetLoraV1LoraLoraNameGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetLoraV1LoraLoraNameGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetLoraV1LoraLoraNameGetXApiKey? 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.GetLoraV1LoraLoraNameGetXApiKey? 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.GetLoraV1LoraLoraNameGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraV1LoraLoraNameGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetLoraV1LoraLoraNameGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXApiKey.g.cs new file mode 100644 index 00000000..23d6f2cc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetLoraV1LoraLoraNameGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 2c52d8e0..501a5124 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetLoraV1LoraLoraNameGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetLoraV1LoraLoraNameGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetLoraV1LoraLoraNameGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 71adacfc..507f0172 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetLoraV1LoraLoraNameGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetLoraV1LoraLoraNameGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.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..fae0c5db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetModelLorasV1ModelModelNameLorasGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXApiKey.Json.g.cs new file mode 100644 index 00000000..fa2900b9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetModelLorasV1ModelModelNameLorasGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetModelLorasV1ModelModelNameLorasGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXApiKey? 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.GetModelLorasV1ModelModelNameLorasGetXApiKey? 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.GetModelLorasV1ModelModelNameLorasGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetModelLorasV1ModelModelNameLorasGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXApiKey.g.cs new file mode 100644 index 00000000..f1946d0b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetModelLorasV1ModelModelNameLorasGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index bc08a12e..c86f8b75 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetModelLorasV1ModelModelNameLorasGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 527437d0..6a2b2997 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetModelLorasV1ModelModelNameLorasGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetModelLorasV1ModelModelNameLorasGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..8f9890dd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetRequestCostsV1RequestCostsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetRequestCostsV1RequestCostsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetRequestCostsV1RequestCostsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.GetRequestCostsV1RequestCostsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetRequestCostsV1RequestCostsPostXApiKey? 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.GetRequestCostsV1RequestCostsPostXApiKey? 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.GetRequestCostsV1RequestCostsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetRequestCostsV1RequestCostsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetRequestCostsV1RequestCostsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXApiKey.g.cs new file mode 100644 index 00000000..762748d1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetRequestCostsV1RequestCostsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 455d33e6..2e5256fa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetRequestCostsV1RequestCostsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetRequestCostsV1RequestCostsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetRequestCostsV1RequestCostsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ab9febfa..b092d835 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetRequestCostsV1RequestCostsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetRequestCostsV1RequestCostsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXApiKey.Json.g.cs new file mode 100644 index 00000000..12579840 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetSshKeysV1SshKeysGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetSshKeysV1SshKeysGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetSshKeysV1SshKeysGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetSshKeysV1SshKeysGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetSshKeysV1SshKeysGetXApiKey? 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.GetSshKeysV1SshKeysGetXApiKey? 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.GetSshKeysV1SshKeysGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetSshKeysV1SshKeysGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetSshKeysV1SshKeysGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXApiKey.g.cs new file mode 100644 index 00000000..bf8d5df5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetSshKeysV1SshKeysGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index a9a89a1f..677eebe0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetSshKeysV1SshKeysGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetSshKeysV1SshKeysGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetSshKeysV1SshKeysGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d1a5112c..2c21e436 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetSshKeysV1SshKeysGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetSshKeysV1SshKeysGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.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..0f939b75 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetUserLorasV1UserLorasGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXApiKey.Json.g.cs new file mode 100644 index 00000000..18c12b91 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetUserLorasV1UserLorasGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetUserLorasV1UserLorasGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetUserLorasV1UserLorasGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetUserLorasV1UserLorasGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetUserLorasV1UserLorasGetXApiKey? 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.GetUserLorasV1UserLorasGetXApiKey? 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.GetUserLorasV1UserLorasGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetUserLorasV1UserLorasGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetUserLorasV1UserLorasGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXApiKey.g.cs new file mode 100644 index 00000000..1cdcf07a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetUserLorasV1UserLorasGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index a6781f6b..88c0e55e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetUserLorasV1UserLorasGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetUserLorasV1UserLorasGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetUserLorasV1UserLorasGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1ec8e24c..c1fd0e5c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetUserLorasV1UserLorasGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetUserLorasV1UserLorasGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..3a97cbaa --- /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.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey.Json.g.cs new file mode 100644 index 00000000..dd09af98 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey? 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.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey? 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.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey.g.cs new file mode 100644 index 00000000..390b0de0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoContentV1OpenaiVideosVideoIdContentGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..d775db66 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey? 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.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey? 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.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey.g.cs new file mode 100644 index 00000000..7e597f88 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoContentV1OpenaiVideosVideoIdContentGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..cea1cf62 --- /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.GetVideoContentV1VideosVideoIdContentGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXApiKey.Json.g.cs new file mode 100644 index 00000000..734e95cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoContentV1VideosVideoIdContentGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoContentV1VideosVideoIdContentGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXApiKey? 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.GetVideoContentV1VideosVideoIdContentGetXApiKey? 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.GetVideoContentV1VideosVideoIdContentGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoContentV1VideosVideoIdContentGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXApiKey.g.cs new file mode 100644 index 00000000..77cd7e96 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoContentV1VideosVideoIdContentGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..7c83031b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoContentV1VideosVideoIdContentGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoContentV1VideosVideoIdContentGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXiApiKey? 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.GetVideoContentV1VideosVideoIdContentGetXiApiKey? 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.GetVideoContentV1VideosVideoIdContentGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoContentV1VideosVideoIdContentGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoContentV1VideosVideoIdContentGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXiApiKey.g.cs new file mode 100644 index 00000000..e47254ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoContentV1VideosVideoIdContentGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoContentV1VideosVideoIdContentGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..3725f399 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey? 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.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey? 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.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey.g.cs new file mode 100644 index 00000000..2726b673 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoGenerationV1OpenaiVideosVideoIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..06ddc749 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey? 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.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey? 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.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey.g.cs new file mode 100644 index 00000000..a77ec1e6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoGenerationV1OpenaiVideosVideoIdGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..e61ab384 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoGenerationV1VideosVideoIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoGenerationV1VideosVideoIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXApiKey? 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.GetVideoGenerationV1VideosVideoIdGetXApiKey? 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.GetVideoGenerationV1VideosVideoIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoGenerationV1VideosVideoIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXApiKey.g.cs new file mode 100644 index 00000000..da1f7d9f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoGenerationV1VideosVideoIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..234ea951 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVideoGenerationV1VideosVideoIdGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVideoGenerationV1VideosVideoIdGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXiApiKey? 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.GetVideoGenerationV1VideosVideoIdGetXiApiKey? 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.GetVideoGenerationV1VideosVideoIdGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVideoGenerationV1VideosVideoIdGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVideoGenerationV1VideosVideoIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXiApiKey.g.cs new file mode 100644 index 00000000..b9883412 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVideoGenerationV1VideosVideoIdGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVideoGenerationV1VideosVideoIdGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..179e27fc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVoiceV1VoicesVoiceIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVoiceV1VoicesVoiceIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXApiKey? 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.GetVoiceV1VoicesVoiceIdGetXApiKey? 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.GetVoiceV1VoicesVoiceIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVoiceV1VoicesVoiceIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXApiKey.g.cs new file mode 100644 index 00000000..126d4d67 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVoiceV1VoicesVoiceIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 25b23360..a453b297 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoiceV1VoicesVoiceIdGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7c3cf4cd..1b5ba325 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoiceV1VoicesVoiceIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetVoiceV1VoicesVoiceIdGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.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..09e8a5e8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesOut.g.cs @@ -39,5 +39,6 @@ public GetVoicesOut( public GetVoicesOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXApiKey.Json.g.cs new file mode 100644 index 00000000..c6a08682 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class GetVoicesV1VoicesGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.GetVoicesV1VoicesGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.GetVoicesV1VoicesGetXApiKey), + jsonSerializerContext) as global::DeepInfra.GetVoicesV1VoicesGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVoicesV1VoicesGetXApiKey? 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.GetVoicesV1VoicesGetXApiKey? 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.GetVoicesV1VoicesGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoicesV1VoicesGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.GetVoicesV1VoicesGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXApiKey.g.cs new file mode 100644 index 00000000..7c7b5250 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class GetVoicesV1VoicesGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index b658e3d2..51e0f0ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GetVoicesV1VoicesGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GetVoicesV1VoicesGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GetVoicesV1VoicesGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b22026d3..85e4393d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GetVoicesV1VoicesGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class GetVoicesV1VoicesGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.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..b8e13d13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubCliLoginGithubCliLoginGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubCliLoginGithubCliLoginGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.Json.g.cs index f66f0ece..1837c7ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetDeal; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GithubLoginGithubLoginGetDeal? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetDeal; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e064de2c..7ec920d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetDeal.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetDeal /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.Json.g.cs index 0833fb47..4d1d0b02 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetLoginId; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GithubLoginGithubLoginGetLoginId? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetLoginId; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3e032fd7..75008089 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetLoginId.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetLoginId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.Json.g.cs index f4d0333b..296b9ea5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetOrigin; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GithubLoginGithubLoginGetOrigin? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetOrigin; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e914a01f..83b8729e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetOrigin.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetOrigin /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.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..4bfe8e40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.Json.g.cs index a7a2f427..49bf97d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GithubLoginGithubLoginGetTiToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GithubLoginGithubLoginGetTiToken? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GithubLoginGithubLoginGetTiToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index aab03976..ed359998 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GithubLoginGithubLoginGetTiToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class GithubLoginGithubLoginGetTiToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.Json.g.cs index 54c4fa48..dfc36e73 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GpuLimitOut; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuLimitOut? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOut; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 440cebfa..08a20bc9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOut.g.cs @@ -53,5 +53,6 @@ public GpuLimitOut( public GpuLimitOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs index dfad955b..54463393 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GpuLimitOutLimits; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuLimitOutLimits? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOutLimits; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 67d854a1..dcd72eee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutLimits.g.cs @@ -14,5 +14,6 @@ public sealed partial class GpuLimitOutLimits /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.Json.g.cs index 1bbcc29c..53de8fda 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GpuLimitOutPendingRequests; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuLimitOutPendingRequests? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOutPendingRequests; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c7c6cb88..a18fcb7e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests.g.cs @@ -14,5 +14,6 @@ public sealed partial class GpuLimitOutPendingRequests /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.Json.g.cs index bd03d8f5..30fd606e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GpuLimitOutPendingRequests2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuLimitOutPendingRequests2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitOutPendingRequests2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8d4af715..413802f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitOutPendingRequests2.g.cs @@ -14,5 +14,6 @@ public sealed partial class GpuLimitOutPendingRequests2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.Json.g.cs index 1df74afe..3ffb0456 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.GpuLimitRequestIn; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.GpuLimitRequestIn? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.GpuLimitRequestIn; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 24075f93..0c81707c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.GpuLimitRequestIn.g.cs @@ -60,5 +60,6 @@ public GpuLimitRequestIn( public GpuLimitRequestIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.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..fd2d6c3d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModel.g.cs @@ -53,5 +53,6 @@ public HFModel( public HFModel() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs index 55dd842c..95b98b77 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HFModelTask; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HFModelTask? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFModelTask; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4506187e..3e00a8ec 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFModelTask.g.cs @@ -14,5 +14,6 @@ public sealed partial class HFModelTask /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs index f51c8573..9baa712c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFTasksE.g.cs @@ -15,6 +15,10 @@ public enum HFTasksE /// /// /// + BareMetal, + /// + /// + /// Custom, /// /// @@ -31,6 +35,10 @@ public enum HFTasksE /// /// /// + Hermes, + /// + /// + /// ImageClassification, /// /// @@ -39,6 +47,10 @@ public enum HFTasksE /// /// /// + Openclaw, + /// + /// + /// QuestionAnswering, /// /// @@ -63,6 +75,10 @@ public enum HFTasksE /// /// /// + TextToMusic, + /// + /// + /// TextToSpeech, /// /// @@ -79,6 +95,10 @@ public enum HFTasksE /// /// /// + WorldModel, + /// + /// + /// ZeroShotImageClassification, } @@ -95,22 +115,27 @@ public static string ToValueString(this HFTasksE value) return value switch { HFTasksE.AutomaticSpeechRecognition => "automatic-speech-recognition", + HFTasksE.BareMetal => "bare-metal", 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.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 +148,27 @@ public static string ToValueString(this HFTasksE value) return value switch { "automatic-speech-recognition" => HFTasksE.AutomaticSpeechRecognition, + "bare-metal" => HFTasksE.BareMetal, "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, "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..36f1e820 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeights.g.cs @@ -64,5 +64,6 @@ public HFWeights( public HFWeights() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs index d0ab535a..2907490a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HFWeightsRevision; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HFWeightsRevision? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFWeightsRevision; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8c4d177d..49c4f7fe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsRevision.g.cs @@ -14,5 +14,6 @@ public sealed partial class HFWeightsRevision /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.Json.g.cs index c5e338b6..18b9f5a0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.HFWeightsToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.HFWeightsToken? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.HFWeightsToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0d23a55c..d3b15d9f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HFWeightsToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class HFWeightsToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.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..c08e1932 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HTTPValidationError.g.cs @@ -39,5 +39,6 @@ public HTTPValidationError( public HTTPValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.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..492be907 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareOption.g.cs @@ -72,5 +72,6 @@ public HardwareOption( public HardwareOption() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.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..a0031cdc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingDedicated.g.cs @@ -40,5 +40,6 @@ public HardwarePricingDedicated( public HardwarePricingDedicated() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.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..a1c98b0c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwarePricingServerless.g.cs @@ -50,5 +50,6 @@ public HardwarePricingServerless( public HardwarePricingServerless() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.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..f2a71568 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.HardwareResponse.g.cs @@ -39,5 +39,6 @@ public HardwareResponse( public HardwareResponse() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.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..429531b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ImageURL.g.cs @@ -52,5 +52,6 @@ public ImageURL( public ImageURL() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.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..114645f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXApiKey.Json.g.cs new file mode 100644 index 00000000..510b03f3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.InferenceDeployV1InferenceDeployDeployIdPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXApiKey), + jsonSerializerContext) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXApiKey? 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.InferenceDeployV1InferenceDeployDeployIdPostXApiKey? 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.InferenceDeployV1InferenceDeployDeployIdPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InferenceDeployV1InferenceDeployDeployIdPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXApiKey.g.cs new file mode 100644 index 00000000..c5eba782 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index bd7de055..ac24dc5c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 23e019fd..069eb0d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceDeployV1InferenceDeployDeployIdPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceDeployV1InferenceDeployDeployIdPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.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..d10329fd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceModelV1InferenceModelNamePostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.Json.g.cs index 6ad5488d..7cfc9e12 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InferenceModelV1InferenceModelNamePostVersion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceModelV1InferenceModelNamePostVersion? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceModelV1InferenceModelNamePostVersion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3c79cba5..ec31f6e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceModelV1InferenceModelNamePostVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXApiKey.Json.g.cs new file mode 100644 index 00000000..2b070e49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InferenceModelV1InferenceModelNamePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.InferenceModelV1InferenceModelNamePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InferenceModelV1InferenceModelNamePostXApiKey), + jsonSerializerContext) as global::DeepInfra.InferenceModelV1InferenceModelNamePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceModelV1InferenceModelNamePostXApiKey? 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.InferenceModelV1InferenceModelNamePostXApiKey? 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.InferenceModelV1InferenceModelNamePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceModelV1InferenceModelNamePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InferenceModelV1InferenceModelNamePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXApiKey.g.cs new file mode 100644 index 00000000..353a323f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InferenceModelV1InferenceModelNamePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 964f6f22..132b86d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InferenceModelV1InferenceModelNamePostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InferenceModelV1InferenceModelNamePostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InferenceModelV1InferenceModelNamePostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 362ca8e3..b1717871 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InferenceModelV1InferenceModelNamePostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class InferenceModelV1InferenceModelNamePostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.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..1190e43a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InputAudio.g.cs @@ -52,5 +52,6 @@ public InputAudio( public InputAudio() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..ddcd21ba --- /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..a8a32f81 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOut.g.cs @@ -65,5 +65,6 @@ public InspectScopedJWTOut( public InspectScopedJWTOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs index db11be93..0e79a2aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InspectScopedJWTOutModels; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InspectScopedJWTOutModels? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJWTOutModels; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 378b1840..ec30fe61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutModels.g.cs @@ -14,5 +14,6 @@ public sealed partial class InspectScopedJWTOutModels /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.Json.g.cs index 6ebd0c34..2dc11b8a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InspectScopedJWTOutSpendingLimit; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InspectScopedJWTOutSpendingLimit? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJWTOutSpendingLimit; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ee4dc828..7fa52921 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJWTOutSpendingLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class InspectScopedJWTOutSpendingLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXApiKey.Json.g.cs new file mode 100644 index 00000000..beec3993 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InspectScopedJwtV1ScopedJwtGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.InspectScopedJwtV1ScopedJwtGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXApiKey), + jsonSerializerContext) as global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXApiKey? 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.InspectScopedJwtV1ScopedJwtGetXApiKey? 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.InspectScopedJwtV1ScopedJwtGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InspectScopedJwtV1ScopedJwtGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXApiKey.g.cs new file mode 100644 index 00000000..c9bc5597 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InspectScopedJwtV1ScopedJwtGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 7d9be011..d0823542 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InspectScopedJwtV1ScopedJwtGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8d108dc3..8f9865b3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InspectScopedJwtV1ScopedJwtGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class InspectScopedJwtV1ScopedJwtGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItem.Json.g.cs new file mode 100644 index 00000000..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..5337ab95 --- /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.InvoiceListItemDueDate.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemDueDate.Json.g.cs new file mode 100644 index 00000000..ad72990f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemDueDate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemDueDate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.InvoiceListItemDueDate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemDueDate), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemDueDate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemDueDate? 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.InvoiceListItemDueDate? 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.InvoiceListItemDueDate), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemDueDate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InvoiceListItemDueDate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemDueDate.g.cs new file mode 100644 index 00000000..dc8b5273 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemDueDate.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemDueDate + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.Json.g.cs new file mode 100644 index 00000000..b9ae6f8d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemHostedInvoiceUrl + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.InvoiceListItemHostedInvoiceUrl? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemHostedInvoiceUrl), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemHostedInvoiceUrl; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemHostedInvoiceUrl? 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.InvoiceListItemHostedInvoiceUrl? 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.InvoiceListItemHostedInvoiceUrl), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemHostedInvoiceUrl; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InvoiceListItemHostedInvoiceUrl.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.g.cs new file mode 100644 index 00000000..a5e2b674 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemHostedInvoiceUrl.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemHostedInvoiceUrl + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.Json.g.cs new file mode 100644 index 00000000..b94728e8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemInvoicePdf + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.InvoiceListItemInvoicePdf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemInvoicePdf), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemInvoicePdf; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemInvoicePdf? 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.InvoiceListItemInvoicePdf? 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.InvoiceListItemInvoicePdf), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemInvoicePdf; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InvoiceListItemInvoicePdf.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.g.cs new file mode 100644 index 00000000..f2dd9840 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoicePdf.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemInvoicePdf + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.Json.g.cs new file mode 100644 index 00000000..7fc2a8fd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemInvoiceType + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.InvoiceListItemInvoiceType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemInvoiceType), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemInvoiceType; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemInvoiceType? 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.InvoiceListItemInvoiceType? 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.InvoiceListItemInvoiceType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemInvoiceType; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InvoiceListItemInvoiceType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.g.cs new file mode 100644 index 00000000..e3699c36 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemInvoiceType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemInvoiceType + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.Json.g.cs new file mode 100644 index 00000000..51b3d2a8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoiceListItemPeriod + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.InvoiceListItemPeriod? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoiceListItemPeriod), + jsonSerializerContext) as global::DeepInfra.InvoiceListItemPeriod; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoiceListItemPeriod? 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.InvoiceListItemPeriod? 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.InvoiceListItemPeriod), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoiceListItemPeriod; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InvoiceListItemPeriod.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.g.cs new file mode 100644 index 00000000..a28dcd72 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoiceListItemPeriod.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoiceListItemPeriod + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.Json.g.cs new file mode 100644 index 00000000..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..7fa049cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOut.g.cs @@ -0,0 +1,64 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoicesOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("invoices")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Invoices { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_more")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasMore { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("next_cursor")] + public string? NextCursor { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public InvoicesOut( + global::System.Collections.Generic.IList invoices, + bool hasMore, + string? nextCursor) + { + this.Invoices = invoices ?? throw new global::System.ArgumentNullException(nameof(invoices)); + this.HasMore = hasMore; + this.NextCursor = nextCursor; + } + + /// + /// Initializes a new instance of the class. + /// + public InvoicesOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.Json.g.cs new file mode 100644 index 00000000..609fd209 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class InvoicesOutNextCursor + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.InvoicesOutNextCursor? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.InvoicesOutNextCursor), + jsonSerializerContext) as global::DeepInfra.InvoicesOutNextCursor; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.InvoicesOutNextCursor? 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.InvoicesOutNextCursor? 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.InvoicesOutNextCursor), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.InvoicesOutNextCursor; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.InvoicesOutNextCursor.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.g.cs new file mode 100644 index 00000000..1c3b2193 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.InvoicesOutNextCursor.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class InvoicesOutNextCursor + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.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..f5cb8fc1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonObjectResponseFormat.g.cs @@ -41,5 +41,6 @@ public JsonObjectResponseFormat( public JsonObjectResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.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..9d5c7070 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchema.g.cs @@ -54,5 +54,6 @@ public JsonSchema( public JsonSchema() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.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..3d79859f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaResponseFormat.g.cs @@ -53,5 +53,6 @@ public JsonSchemaResponseFormat( public JsonSchemaResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.JsonSchemaSchema.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..756b40a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LLMDeploymentStatsOut.g.cs @@ -138,5 +138,6 @@ public LLMDeploymentStatsOut( public LLMDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs index e6cf20a5..1862faf6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetAfter; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListFilesV1FilesGetAfter? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetAfter; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8624af92..90769024 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetAfter.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetAfter /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.Json.g.cs index e42fe349..dc66af69 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetOrder; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListFilesV1FilesGetOrder? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetOrder; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index eee9d300..3fb2c6c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetOrder.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetOrder /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.Json.g.cs index 2ff74c47..9d13d8bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetPurpose; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListFilesV1FilesGetPurpose? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetPurpose; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7a174fd5..33ef0dae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetPurpose.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetPurpose /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.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..3b7e1501 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXApiKey.Json.g.cs new file mode 100644 index 00000000..d1c0ce44 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ListFilesV1FilesGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ListFilesV1FilesGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ListFilesV1FilesGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListFilesV1FilesGetXApiKey? 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.ListFilesV1FilesGetXApiKey? 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.ListFilesV1FilesGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ListFilesV1FilesGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXApiKey.g.cs new file mode 100644 index 00000000..ebe195ca --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListFilesV1FilesGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 199b0c86..59f4562b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ListFilesV1FilesGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListFilesV1FilesGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1FilesGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f02094fe..77cd4e13 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1FilesGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ListFilesV1FilesGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.Json.g.cs deleted file mode 100644 index 21cbe6a2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetAfter - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetAfter? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetAfter), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetAfter; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.ListFilesV1OpenaiFilesGetAfter? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetAfter), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetAfter; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.g.cs deleted file mode 100644 index fdfa568c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetAfter.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetAfter - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.Json.g.cs deleted file mode 100644 index 287ffd81..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetOrder - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetOrder? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetOrder), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetOrder; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.ListFilesV1OpenaiFilesGetOrder? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetOrder), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetOrder; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.g.cs deleted file mode 100644 index 6dadb0fe..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetOrder.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetOrder - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.Json.g.cs deleted file mode 100644 index 95c29f4e..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetPurpose - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetPurpose; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.g.cs deleted file mode 100644 index 5463f94a..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetPurpose.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetPurpose - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.Json.g.cs deleted file mode 100644 index 49add4d9..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetResponse), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.ListFilesV1OpenaiFilesGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.g.cs deleted file mode 100644 index 66305c87..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.Json.g.cs deleted file mode 100644 index 19cba389..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ListFilesV1OpenaiFilesGetXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListFilesV1OpenaiFilesGetXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.g.cs deleted file mode 100644 index 08f524ce..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListFilesV1OpenaiFilesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ListFilesV1OpenaiFilesGetXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.Json.g.cs new file mode 100644 index 00000000..908c1617 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ListInvoicesPaymentInvoicesGetInvoiceType + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ListInvoicesPaymentInvoicesGetInvoiceType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType), + jsonSerializerContext) as global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType? 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.ListInvoicesPaymentInvoicesGetInvoiceType? 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.ListInvoicesPaymentInvoicesGetInvoiceType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListInvoicesPaymentInvoicesGetInvoiceType; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ListInvoicesPaymentInvoicesGetInvoiceType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.g.cs new file mode 100644 index 00000000..2cf3199a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetInvoiceType.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListInvoicesPaymentInvoicesGetInvoiceType + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.Json.g.cs new file mode 100644 index 00000000..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..0d5d569f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetSession.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListInvoicesPaymentInvoicesGetSession + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.Json.g.cs new file mode 100644 index 00000000..f6347f59 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ListInvoicesPaymentInvoicesGetStartingAfter + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ListInvoicesPaymentInvoicesGetStartingAfter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter), + jsonSerializerContext) as global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter? 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.ListInvoicesPaymentInvoicesGetStartingAfter? 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.ListInvoicesPaymentInvoicesGetStartingAfter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ListInvoicesPaymentInvoicesGetStartingAfter; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ListInvoicesPaymentInvoicesGetStartingAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.g.cs new file mode 100644 index 00000000..5614e170 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ListInvoicesPaymentInvoicesGetStartingAfter.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ListInvoicesPaymentInvoicesGetStartingAfter + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.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..073ae18f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogQueryOut.g.cs @@ -12,7 +12,7 @@ public sealed partial class LogQueryOut /// list of log lines ordered by increasing timestamp /// [global::System.Text.Json.Serialization.JsonPropertyName("entries")] - public global::System.Collections.Generic.IList? Entries { get; set; } + public global::System.Collections.Generic.IList>? Entries { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -30,7 +30,7 @@ public sealed partial class LogQueryOut [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public LogQueryOut( - global::System.Collections.Generic.IList? entries) + global::System.Collections.Generic.IList>? entries) { this.Entries = entries; } @@ -41,5 +41,6 @@ public LogQueryOut( public LogQueryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.Json.g.cs index b306386b..29aaa178 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetFrom; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LogsQueryV1LogsQueryGetFrom? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetFrom; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 5687f40e..5cc6b545 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetFrom.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogsQueryV1LogsQueryGetFrom /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.Json.g.cs index 308d3ff1..30ce63f1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetTo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LogsQueryV1LogsQueryGetTo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetTo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 569935c2..c5be0a0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogsQueryV1LogsQueryGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXApiKey.Json.g.cs new file mode 100644 index 00000000..7bcd00be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class LogsQueryV1LogsQueryGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.LogsQueryV1LogsQueryGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.LogsQueryV1LogsQueryGetXApiKey), + jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LogsQueryV1LogsQueryGetXApiKey? 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.LogsQueryV1LogsQueryGetXApiKey? 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.LogsQueryV1LogsQueryGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.LogsQueryV1LogsQueryGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXApiKey.g.cs new file mode 100644 index 00000000..623cfde3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class LogsQueryV1LogsQueryGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index a5f7c2c7..e18e8f8a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LogsQueryV1LogsQueryGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LogsQueryV1LogsQueryGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LogsQueryV1LogsQueryGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 92d4a12f..ad408eb6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LogsQueryV1LogsQueryGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class LogsQueryV1LogsQueryGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.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..89296a31 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadIn.g.cs @@ -68,5 +68,6 @@ public LoraModelUploadIn( public LoraModelUploadIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs index c75d176b..93eb062c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LoraModelUploadInBaseModelName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LoraModelUploadInBaseModelName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LoraModelUploadInBaseModelName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index cac995cd..6a84a70f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInBaseModelName.g.cs @@ -14,5 +14,6 @@ public sealed partial class LoraModelUploadInBaseModelName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.Json.g.cs index 5eb9b0c8..912ab476 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.LoraModelUploadInHfToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.LoraModelUploadInHfToken? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.LoraModelUploadInHfToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8f37377d..eba6d22e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.LoraModelUploadInHfToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class LoraModelUploadInHfToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.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..2110a34b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Me.g.cs @@ -68,6 +68,13 @@ public sealed partial class Me [global::System.Text.Json.Serialization.JsonRequired] public required bool IsAdmin { get; set; } + /// + /// Whether the user may use the hosted-agents feature (admins, plus the AGENTS_ACCESS_UIDS allowlist)
+ /// Default Value: false + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("can_access_agents")] + public bool? CanAccessAgents { get; set; } + /// /// Personal name /// @@ -212,6 +219,10 @@ public sealed partial class Me /// Default Value: false /// /// + /// + /// Whether the user may use the hosted-agents feature (admins, plus the AGENTS_ACCESS_UIDS allowlist)
+ /// Default Value: false + /// /// /// Default Value: false /// @@ -246,6 +257,7 @@ public Me( string? email, bool? requireEmailVerified, string? picture, + bool? canAccessAgents, bool? isTeamAccount, bool? isTeamOwner, string? teamRole, @@ -263,6 +275,7 @@ public Me( this.Provider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); this.Picture = picture; this.IsAdmin = isAdmin; + this.CanAccessAgents = canAccessAgents; this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.FirstName = firstName ?? throw new global::System.ArgumentNullException(nameof(firstName)); this.LastName = lastName ?? throw new global::System.ArgumentNullException(nameof(lastName)); @@ -286,5 +299,6 @@ public Me( public Me() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.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..0acd7c33 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeChecklist.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeChecklist /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.Json.g.cs index c3c9a053..53f1e784 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeEmail; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeEmail? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeEmail; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4f6d9c36..84f36449 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.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..88ab79bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeIn.g.cs @@ -80,6 +80,18 @@ public sealed partial class MeIn [global::System.Text.Json.Serialization.JsonPropertyName("attribution")] public string? Attribution { get; set; } + /// + /// Set to false to opt out of marketing emails + /// + [global::System.Text.Json.Serialization.JsonPropertyName("marketing_emails")] + public bool? MarketingEmails { get; set; } + + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// + [global::System.Text.Json.Serialization.JsonPropertyName("country_code")] + public string? CountryCode { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -121,6 +133,12 @@ public sealed partial class MeIn /// /// Short description of how the user found out about DeepInfra /// + /// + /// Set to false to opt out of marketing emails + /// + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -136,7 +154,9 @@ public MeIn( string? title, string? displayName, string? useCase, - string? attribution) + string? attribution, + bool? marketingEmails, + string? countryCode) { this.Name = name; this.FirstName = firstName; @@ -150,6 +170,8 @@ public MeIn( this.DisplayName = displayName; this.UseCase = useCase; this.Attribution = attribution; + this.MarketingEmails = marketingEmails; + this.CountryCode = countryCode; } /// @@ -158,5 +180,6 @@ public MeIn( public MeIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.Json.g.cs index 42ce62b2..f7790a17 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInAttribution; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInAttribution? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInAttribution; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8bf953d6..f59fe7bf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInAttribution.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInAttribution /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.Json.g.cs index 626e4944..50295130 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInCompany; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInCompany? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInCompany; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d81013ae..7abefa9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCompany.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInCompany /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.Json.g.cs index 81e225e4..0c5dcff3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInCountry; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInCountry? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInCountry; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3db6a179..114af616 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountry.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInCountry /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.Json.g.cs new file mode 100644 index 00000000..45e818fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class MeInCountryCode + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.MeInCountryCode? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.MeInCountryCode), + jsonSerializerContext) as global::DeepInfra.MeInCountryCode; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInCountryCode? 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.MeInCountryCode? 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.MeInCountryCode), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInCountryCode; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.MeInCountryCode.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.g.cs new file mode 100644 index 00000000..905179e0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInCountryCode.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ISO 3166-1 alpha-2 country code of the user selected country + /// + public sealed partial class MeInCountryCode + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.Json.g.cs index 6fc33cc9..0a6de268 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInDisplayName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInDisplayName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInDisplayName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 239d2816..25a0f17e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInDisplayName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInDisplayName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.Json.g.cs index e1dc55c7..60378d7e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInEmail; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInEmail? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInEmail; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9d1ba97b..46d5529d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInEmail.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInEmail /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.Json.g.cs index a9e93634..227aa5fe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInFirstName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInFirstName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInFirstName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8341e0be..836a4e84 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInFirstName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInFirstName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.Json.g.cs index f3f32b60..858fe13e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInIsBusinessAccount; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInIsBusinessAccount? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInIsBusinessAccount; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0c4bc7fd..095553c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInIsBusinessAccount.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInIsBusinessAccount /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.Json.g.cs index 0581e7e4..4f405580 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInLastName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInLastName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInLastName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c71a8e33..44ec50af 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInLastName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInLastName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.Json.g.cs new file mode 100644 index 00000000..8734a51c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class MeInMarketingEmails + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.MeInMarketingEmails? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.MeInMarketingEmails), + jsonSerializerContext) as global::DeepInfra.MeInMarketingEmails; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInMarketingEmails? 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.MeInMarketingEmails? 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.MeInMarketingEmails), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInMarketingEmails; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.MeInMarketingEmails.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.g.cs new file mode 100644 index 00000000..b246ebfe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInMarketingEmails.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Set to false to opt out of marketing emails + /// + public sealed partial class MeInMarketingEmails + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.Json.g.cs index 7c0444dc..15d6376a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 44ae9219..e5c1715c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.Json.g.cs index 72eabcdb..4ac7fc43 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInTitle; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInTitle? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInTitle; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9e423b8d..c475f2db 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInTitle.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInTitle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.Json.g.cs index fa4f46a5..9296f1b9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInUseCase; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInUseCase? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInUseCase; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 94405092..dd634d11 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInUseCase.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInUseCase /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.Json.g.cs index 7a37a9ff..545c044d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeInWebsite; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeInWebsite? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeInWebsite; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 18fd85a0..a8335e79 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeInWebsite.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeInWebsite /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.Json.g.cs index 93eae3cd..39558961 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MePicture; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MePicture? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MePicture; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4dfeca74..49c0f650 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MePicture.g.cs @@ -14,5 +14,6 @@ public sealed partial class MePicture /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.Json.g.cs index 12c376e7..ecd74e63 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeTeamDisplayName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeTeamDisplayName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeTeamDisplayName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ff7502ea..a23c24d9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamDisplayName.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeTeamDisplayName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.Json.g.cs index a82a5b95..2bfccb23 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeTeamRole; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeTeamRole? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeTeamRole; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4857d5bb..9595a465 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeTeamRole.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeTeamRole /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXApiKey.Json.g.cs new file mode 100644 index 00000000..35cb54ad --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class MeV1MeGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.MeV1MeGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.MeV1MeGetXApiKey), + jsonSerializerContext) as global::DeepInfra.MeV1MeGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeV1MeGetXApiKey? 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.MeV1MeGetXApiKey? 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.MeV1MeGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeV1MeGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.MeV1MeGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXApiKey.g.cs new file mode 100644 index 00000000..02164c11 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class MeV1MeGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 85bb4c9f..092fb76a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeV1MeGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeV1MeGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeV1MeGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 95a4d871..f86fe47b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeV1MeGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeV1MeGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.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..d38e1a61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeVercelConnection /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.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..0ce70326 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnection2.g.cs @@ -59,5 +59,6 @@ public MeVercelConnection2( public MeVercelConnection2() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs index 9c3fd98d..365dfe40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.MeVercelConnectionTeamId; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.MeVercelConnectionTeamId? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.MeVercelConnectionTeamId; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2ebba383..aa823c1c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.MeVercelConnectionTeamId.g.cs @@ -14,5 +14,6 @@ public sealed partial class MeVercelConnectionTeamId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.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..a2a4ccb8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelDeleteModelsModelNameDeleteResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..790f4c5c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelDeleteModelsModelNameDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelDeleteModelsModelNameDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelDeleteModelsModelNameDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelDeleteModelsModelNameDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelDeleteModelsModelNameDeleteXApiKey? 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.ModelDeleteModelsModelNameDeleteXApiKey? 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.ModelDeleteModelsModelNameDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelDeleteModelsModelNameDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelDeleteModelsModelNameDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXApiKey.g.cs new file mode 100644 index 00000000..c7acb7fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelDeleteModelsModelNameDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 2ba0f88d..6a41aa31 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelDeleteModelsModelNameDeleteXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelDeleteModelsModelNameDeleteXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelDeleteModelsModelNameDeleteXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0f0d6fd2..e48f972b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDeleteModelsModelNameDeleteXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelDeleteModelsModelNameDeleteXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.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..ea92114b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelDocBlock.g.cs @@ -51,5 +51,6 @@ public ModelDocBlock( public ModelDocBlock() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.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..38d381b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOut.g.cs @@ -131,5 +131,6 @@ public ModelFamilyOut( public ModelFamilyOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs index fd344703..baff4c00 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFamilyOutMetaDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFamilyOutMetaDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFamilyOutMetaDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2128156b..f7dc3082 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFamilyOutMetaDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.Json.g.cs index fdde59ee..7a26cb9b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFamilyOutMetaTitle; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFamilyOutMetaTitle? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFamilyOutMetaTitle; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f3e09eca..45dbbd40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFamilyOutMetaTitle.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFamilyOutMetaTitle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.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..7f026b4a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfo.g.cs @@ -133,5 +133,6 @@ public ModelFieldInfo( public ModelFieldInfo() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs index 6d37a119..368b4475 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoAllowed; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoAllowed? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoAllowed; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 29e96b12..abb98d3c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowed.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoAllowed /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.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..f0608d35 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoAllowedVariant1Item.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoAllowedVariant1Item /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.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..314d44bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDefault.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoDefault /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.Json.g.cs index c4d04d25..7bccd857 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a62238ba..3699f742 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.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..0301e018 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExample.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoExample /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.Json.g.cs index e82a6476..732dbe28 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoExclusiveMaximum; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoExclusiveMaximum? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoExclusiveMaximum; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7ae1451b..cd2d10a0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMaximum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoExclusiveMaximum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.Json.g.cs index deee3e61..e05aba3f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoExclusiveMinimum; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoExclusiveMinimum? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoExclusiveMinimum; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 55e31282..b1a4c1e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoExclusiveMinimum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoExclusiveMinimum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.Json.g.cs index fa8c1721..daa9a726 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoMaximum; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoMaximum? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoMaximum; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0a24b053..03639cc1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMaximum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoMaximum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.Json.g.cs index f25851a6..ba9dbf04 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoMinimum; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoMinimum? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoMinimum; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b5a00584..d6dc1c8a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoMinimum.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoMinimum /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.Json.g.cs index b27336e5..90f706d8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelFieldInfoParent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelFieldInfoParent? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelFieldInfoParent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 92117148..de50b374 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelFieldInfoParent.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelFieldInfoParent /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.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..d22ad344 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOut.g.cs @@ -110,12 +110,6 @@ public sealed partial class ModelInfoOut [global::System.Text.Json.Serialization.JsonRequired] public required string OutDocs { get; set; } - /// - /// - /// - [global::System.Text.Json.Serialization.JsonPropertyName("mask_token")] - public string? MaskToken { get; set; } - /// /// /// @@ -138,9 +132,9 @@ public sealed partial class ModelInfoOut /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf Pricing { get; set; } + public required global::DeepInfra.AnyOf Pricing { get; set; } /// /// @@ -267,7 +261,6 @@ public sealed partial class ModelInfoOut /// /// Default Value: false /// - /// /// /// /// @@ -308,12 +301,11 @@ public ModelInfoOut( string txtDocs, string outExample, string outDocs, - global::DeepInfra.AnyOf pricing, + global::DeepInfra.AnyOf pricing, global::System.Collections.Generic.IList schemas, string? description, string? mfDescription, bool? owner, - string? maskToken, object? inSchema, object? outSchema, global::System.Collections.Generic.IList? inFields, @@ -348,7 +340,6 @@ public ModelInfoOut( this.TxtDocs = txtDocs ?? throw new global::System.ArgumentNullException(nameof(txtDocs)); this.OutExample = outExample ?? throw new global::System.ArgumentNullException(nameof(outExample)); this.OutDocs = outDocs ?? throw new global::System.ArgumentNullException(nameof(outDocs)); - this.MaskToken = maskToken; this.InSchema = inSchema; this.OutSchema = outSchema; this.InFields = inFields; @@ -377,5 +368,6 @@ public ModelInfoOut( public ModelInfoOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.Json.g.cs index 3a75657c..0bebbf28 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutDeprecated; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutDeprecated? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutDeprecated; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e131cc55..fe4dcea4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDeprecated.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutDeprecated /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.Json.g.cs index b26d2573..aaf77d0e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d0865c18..537e308d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.Json.g.cs index 994834e0..8dbfd562 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutDocBlocks; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutDocBlocks? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutDocBlocks; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4b06fefb..088cbf83 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutDocBlocks.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutDocBlocks /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.Json.g.cs index 765beb49..1060e085 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutExpected; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutExpected? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutExpected; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 35b64ef2..b7b20d33 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutExpected.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutExpected /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.Json.g.cs index cc2cf112..77caf5a7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutImportTime; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutImportTime? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutImportTime; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index e719e8b5..77dca7da 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutImportTime.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutImportTime /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.Json.g.cs index e608c2c2..8290907c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutInFields; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutInFields? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutInFields; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1f527ce3..7d6dee6f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInFields.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutInFields /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.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..c02734c0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutInSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutInSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.Json.g.cs deleted file mode 100644 index 748b06ae..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class ModelInfoOutMaskToken - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.ModelInfoOutMaskToken? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.ModelInfoOutMaskToken), - jsonSerializerContext) as global::DeepInfra.ModelInfoOutMaskToken; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.ModelInfoOutMaskToken? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.ModelInfoOutMaskToken), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMaskToken; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.g.cs deleted file mode 100644 index ccdfabde..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaskToken.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class ModelInfoOutMaskToken - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.Json.g.cs index ddd2b9d0..92421ec2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMaxOutputTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMaxOutputTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMaxOutputTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 25ce807f..8394afee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxOutputTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMaxOutputTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.Json.g.cs index 286e2b33..442863b2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMaxTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMaxTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMaxTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b326525a..8be8bd2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMeta.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 index 35fa7cf1..a5eb2616 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMfDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMfDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMfDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ad334b76..9c5b8230 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMfDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.Json.g.cs index a5fe85b5..20c3d785 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMfName; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMfName? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMfName; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 161b812e..84a2573b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfName.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMfName /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.Json.g.cs index 9a9dc340..01348d2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMfTitle; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMfTitle? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMfTitle; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index dfd93934..ce2de0ca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMfTitle.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMfTitle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.Json.g.cs index be5bc26b..e3ab3a69 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutMmlu; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutMmlu? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutMmlu; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 6fe164ea..ac836137 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutMmlu.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutMmlu /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.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..21670294 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutOutSchema.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutOutSchema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.Json.g.cs index 66e07821..61529a1b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutQuantization; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutQuantization? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutQuantization; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 883b0832..93c3cecb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutQuantization.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutQuantization /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.Json.g.cs index b624c6ac..dc60f67d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelInfoOutReplacedBy; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelInfoOutReplacedBy? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelInfoOutReplacedBy; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0c9f9f43..0395e1f7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutReplacedBy.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutReplacedBy /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.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..f9ddf10d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelInfoOutShortDocBlock.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelInfoOutShortDocBlock /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.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..fad2a779 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.cs @@ -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.ModelMetaContract.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaContract.Json.g.cs new file mode 100644 index 00000000..ee4670bf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaContract.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetaContract + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelMetaContract? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetaContract), + jsonSerializerContext) as global::DeepInfra.ModelMetaContract; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaContract? 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.ModelMetaContract? 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.ModelMetaContract), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaContract; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetaContract.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaContract.g.cs new file mode 100644 index 00000000..454c2124 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaContract.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// bare-metal contract description, shown like on invoices + /// + public sealed partial class ModelMetaContract + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..e428f002 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaIn.g.cs @@ -107,5 +107,6 @@ public ModelMetaIn( public ModelMetaIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs index 069ab975..7eaa686c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInCoverImgUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInCoverImgUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInCoverImgUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3bd0bc55..7f0e1b5e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInCoverImgUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInCoverImgUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.Json.g.cs index 68535d5f..8710d31d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9781ca4a..727be1bb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.Json.g.cs index 29d235b3..cc38d1d8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInGithubUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInGithubUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInGithubUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 012fee59..cc3bbc6a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInGithubUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInGithubUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.Json.g.cs index 59e721f0..dbe8a3da 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInLicenseUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInLicenseUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInLicenseUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 649ced18..6d330987 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInLicenseUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInLicenseUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.Json.g.cs index 9edcf3e0..3c25dc26 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInPaperUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInPaperUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInPaperUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index bf51cb9d..5cdd547e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInPaperUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInPaperUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.Json.g.cs index a6f008e6..d9fcc315 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInReadme; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInReadme? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInReadme; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 572deaba..a0285092 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReadme.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaInReadme /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.Json.g.cs index 004182ad..2f55f0ca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaInReportedType.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaInReportedType; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaInReportedType? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaInReportedType; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 6661854b..0c18e449 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaPlanId; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaPlanId? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaPlanId; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b1778cff..1a05f37f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaPlanId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.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..ac84bdbc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaUpdateModelsModelNameMetaPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXApiKey.Json.g.cs new file mode 100644 index 00000000..d0c441d6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetaUpdateModelsModelNameMetaPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelMetaUpdateModelsModelNameMetaPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXApiKey? 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.ModelMetaUpdateModelsModelNameMetaPostXApiKey? 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.ModelMetaUpdateModelsModelNameMetaPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetaUpdateModelsModelNameMetaPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXApiKey.g.cs new file mode 100644 index 00000000..ae40cff1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetaUpdateModelsModelNameMetaPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index c2946ed8..785783ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetaUpdateModelsModelNameMetaPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d09bda81..dec88614 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaUpdateModelsModelNameMetaPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetaUpdateModelsModelNameMetaPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.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..a2c8aa35 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.cs @@ -4,7 +4,17 @@ namespace DeepInfra { /// - /// + /// Per-model metadata exposed by ``/v1/openai/models``.
+ /// Pricing key names are surface-specific:
+ /// - chat / vlm: {"input_tokens", "output_tokens", "cache_read_tokens"} ($/1M tokens)
+ /// - embed: {"input_tokens"} ($/1M tokens)
+ /// - image-gen: {"per_image_unit"} ($/image at default geometry)
+ /// - video-gen: {"output_seconds"} ($/sec generated)
+ /// - tts: {"input_characters"} ($/1M input chars)
+ /// - stt: {"input_seconds"} ($/sec input audio)
+ /// ``tags`` always carries the surface short alias (e.g. ``'chat'``,
+ /// ``'image-gen'``) and, for chat models, any of ``'vision'``,
+ /// ``'prompt_cache'``, ``'reasoning_effort'``, ``'reasoning'``. ///
public sealed partial class ModelMetadata { @@ -19,15 +29,13 @@ public sealed partial class ModelMetadata /// /// [global::System.Text.Json.Serialization.JsonPropertyName("context_length")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int ContextLength { get; set; } + public int? ContextLength { get; set; } /// /// /// [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens")] - [global::System.Text.Json.Serialization.JsonRequired] - public required int MaxTokens { get; set; } + public int? MaxTokens { get; set; } /// /// @@ -43,6 +51,24 @@ public sealed partial class ModelMetadata [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList Tags { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_width")] + public int? DefaultWidth { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_height")] + public int? DefaultHeight { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_iterations")] + public int? DefaultIterations { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -53,25 +79,34 @@ public sealed partial class ModelMetadata /// Initializes a new instance of the class. /// /// - /// - /// /// /// + /// + /// + /// + /// + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public ModelMetadata( string description, - int contextLength, - int maxTokens, global::System.Collections.Generic.Dictionary pricing, - global::System.Collections.Generic.IList tags) + global::System.Collections.Generic.IList tags, + int? contextLength, + int? maxTokens, + int? defaultWidth, + int? defaultHeight, + int? defaultIterations) { this.Description = description ?? throw new global::System.ArgumentNullException(nameof(description)); this.ContextLength = contextLength; this.MaxTokens = maxTokens; this.Pricing = pricing ?? throw new global::System.ArgumentNullException(nameof(pricing)); this.Tags = tags ?? throw new global::System.ArgumentNullException(nameof(tags)); + this.DefaultWidth = defaultWidth; + this.DefaultHeight = defaultHeight; + this.DefaultIterations = defaultIterations; } /// @@ -80,5 +115,6 @@ public ModelMetadata( public ModelMetadata() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.Json.g.cs new file mode 100644 index 00000000..a4bb731b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataContextLength + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelMetadataContextLength? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataContextLength), + jsonSerializerContext) as global::DeepInfra.ModelMetadataContextLength; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataContextLength? 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.ModelMetadataContextLength? 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.ModelMetadataContextLength), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataContextLength; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetadataContextLength.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.g.cs new file mode 100644 index 00000000..da896ef6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataContextLength.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataContextLength + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.Json.g.cs new file mode 100644 index 00000000..62ca3ba1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataDefaultHeight + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelMetadataDefaultHeight? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataDefaultHeight), + jsonSerializerContext) as global::DeepInfra.ModelMetadataDefaultHeight; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataDefaultHeight? 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.ModelMetadataDefaultHeight? 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.ModelMetadataDefaultHeight), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataDefaultHeight; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetadataDefaultHeight.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.g.cs new file mode 100644 index 00000000..ed7e8431 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultHeight.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataDefaultHeight + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.Json.g.cs new file mode 100644 index 00000000..6d0ed2d7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataDefaultIterations + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelMetadataDefaultIterations? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataDefaultIterations), + jsonSerializerContext) as global::DeepInfra.ModelMetadataDefaultIterations; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataDefaultIterations? 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.ModelMetadataDefaultIterations? 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.ModelMetadataDefaultIterations), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataDefaultIterations; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetadataDefaultIterations.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.g.cs new file mode 100644 index 00000000..dffc27f4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultIterations.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataDefaultIterations + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.Json.g.cs new file mode 100644 index 00000000..8d9b553e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataDefaultWidth + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelMetadataDefaultWidth? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataDefaultWidth), + jsonSerializerContext) as global::DeepInfra.ModelMetadataDefaultWidth; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataDefaultWidth? 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.ModelMetadataDefaultWidth? 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.ModelMetadataDefaultWidth), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataDefaultWidth; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetadataDefaultWidth.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.g.cs new file mode 100644 index 00000000..639be49b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataDefaultWidth.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataDefaultWidth + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.Json.g.cs new file mode 100644 index 00000000..584d4c10 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelMetadataMaxTokens + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelMetadataMaxTokens? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelMetadataMaxTokens), + jsonSerializerContext) as global::DeepInfra.ModelMetadataMaxTokens; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelMetadataMaxTokens? 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.ModelMetadataMaxTokens? 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.ModelMetadataMaxTokens), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelMetadataMaxTokens; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelMetadataMaxTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.g.cs new file mode 100644 index 00000000..366e2574 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataMaxTokens.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelMetadataMaxTokens + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.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..5e71ab51 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelMetadataPricing /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.Json.g.cs new file mode 100644 index 00000000..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..39902706 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelNameSuggestionOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelNameSuggestionOut + { + /// + /// A model name that is currently free to claim (prefixed in username/model-name format). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("model_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string ModelName { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A model name that is currently free to claim (prefixed in username/model-name format). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelNameSuggestionOut( + string modelName) + { + this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); + } + + /// + /// Initializes a new instance of the class. + /// + public ModelNameSuggestionOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.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..2ae41295 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOut.g.cs @@ -51,9 +51,9 @@ public sealed partial class ModelOut /// The pricing type and cost for this model /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf Pricing { get; set; } + public required global::DeepInfra.AnyOf Pricing { get; set; } /// /// The maximum context size of this model, if applicable @@ -91,6 +91,12 @@ public sealed partial class ModelOut [global::System.Text.Json.Serialization.JsonPropertyName("expected")] public string? Expected { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("create_ts")] + public string? CreateTs { get; set; } + /// /// Default Value: 0 /// @@ -141,6 +147,7 @@ public sealed partial class ModelOut /// /// /// + /// /// /// Default Value: 0 /// @@ -154,7 +161,7 @@ public ModelOut( string modelName, string type, string reportedType, - global::DeepInfra.AnyOf pricing, + global::DeepInfra.AnyOf pricing, string? description, string? coverImgUrl, global::System.Collections.Generic.IList? tags, @@ -164,6 +171,7 @@ public ModelOut( string? quantization, double? mmlu, string? expected, + string? createTs, int? @private, bool? isPartner) { @@ -180,6 +188,7 @@ public ModelOut( this.Quantization = quantization; this.Mmlu = mmlu; this.Expected = expected; + this.CreateTs = createTs; this.Private = @private; this.IsPartner = isPartner; } @@ -190,5 +199,6 @@ public ModelOut( public ModelOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.Json.g.cs new file mode 100644 index 00000000..d82ad6fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelOutCreateTs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelOutCreateTs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelOutCreateTs), + jsonSerializerContext) as global::DeepInfra.ModelOutCreateTs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutCreateTs? 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.ModelOutCreateTs? 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.ModelOutCreateTs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutCreateTs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelOutCreateTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.g.cs new file mode 100644 index 00000000..4d61ac6b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutCreateTs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelOutCreateTs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.Json.g.cs index 9c884ed6..450be5d6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOutDeprecated; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutDeprecated? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutDeprecated; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7d8c2b68..68cc9706 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutDeprecated.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutDeprecated /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.Json.g.cs index cf947f93..d1bbaa63 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOutExpected; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutExpected? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutExpected; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 47b3f562..25d9ea59 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutExpected.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutExpected /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.Json.g.cs index b66a6cd8..8c971942 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOutMaxTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutMaxTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutMaxTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2f17ab82..5fbb8f4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.Json.g.cs index 49849d58..28765f08 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOutMmlu; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutMmlu? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutMmlu; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index dd88e584..25c27410 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutMmlu.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutMmlu /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.Json.g.cs index 15dfa5ce..b4e0a725 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOutQuantization; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutQuantization? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutQuantization; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 296b5a3d..2b094d03 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutQuantization.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutQuantization /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.Json.g.cs index 86da16b1..eb6df790 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelOutReplacedBy; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelOutReplacedBy? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelOutReplacedBy; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 6e7d3478..cd6e42bc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelOutReplacedBy.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelOutReplacedBy /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.Json.g.cs new file mode 100644 index 00000000..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..78009d2a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnits.g.cs @@ -0,0 +1,89 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingFrameUnits + { + /// + /// Short description of the pricing, ideal for cards and headers + /// + [global::System.Text.Json.Serialization.JsonPropertyName("short")] + public string? Short { get; set; } + + /// + /// Full description of the pricing, perfect for details + /// + [global::System.Text.Json.Serialization.JsonPropertyName("full")] + public string? Full { get; set; } + + /// + /// Could be used to generate pricing tables + /// + [global::System.Text.Json.Serialization.JsonPropertyName("table")] + public object? Table { get; set; } + + /// + /// Default Value: frame_units + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cents_per_frame_unit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double CentsPerFrameUnit { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// Short description of the pricing, ideal for cards and headers + /// + /// + /// Full description of the pricing, perfect for details + /// + /// + /// Could be used to generate pricing tables + /// + /// + /// Default Value: frame_units + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelPricingFrameUnits( + double centsPerFrameUnit, + string? @short, + string? full, + object? table, + string? type) + { + this.Short = @short; + this.Full = full; + this.Table = table; + this.Type = type; + this.CentsPerFrameUnit = centsPerFrameUnit; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelPricingFrameUnits() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.Json.g.cs new file mode 100644 index 00000000..1963e049 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnitsFull + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelPricingFrameUnitsFull? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnitsFull), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnitsFull; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsFull? 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.ModelPricingFrameUnitsFull? 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.ModelPricingFrameUnitsFull), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsFull; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelPricingFrameUnitsFull.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.g.cs new file mode 100644 index 00000000..1ed7da49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsFull.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Full description of the pricing, perfect for details + /// + public sealed partial class ModelPricingFrameUnitsFull + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.Json.g.cs new file mode 100644 index 00000000..f0175943 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPricingFrameUnitsShort + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.ModelPricingFrameUnitsShort? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPricingFrameUnitsShort), + jsonSerializerContext) as global::DeepInfra.ModelPricingFrameUnitsShort; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingFrameUnitsShort? 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.ModelPricingFrameUnitsShort? 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.ModelPricingFrameUnitsShort), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingFrameUnitsShort; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelPricingFrameUnitsShort.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.g.cs new file mode 100644 index 00000000..f52251cc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsShort.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Short description of the pricing, ideal for cards and headers + /// + public sealed partial class ModelPricingFrameUnitsShort + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable.Json.g.cs new file mode 100644 index 00000000..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..efb3dd01 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingFrameUnitsTable2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPricingFrameUnitsTable2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.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..8c760a53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnits.g.cs @@ -133,5 +133,6 @@ public ModelPricingImageUnits( public ModelPricingImageUnits() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs index 26d2ddb1..0e75a4f0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsDefaultPriceCents; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingImageUnitsDefaultPriceCents? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsDefaultPriceCents; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 47f1bc1c..643f77d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsDefaultPriceCents.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsDefaultPriceCents /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.Json.g.cs index 067b7127..347f7d57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingImageUnitsFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1989728c..b9f12246 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.Json.g.cs index 4aed0763..e2e1146e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingImageUnitsShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingImageUnitsShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingImageUnitsShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index eff3ef73..4c648178 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable.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..1bee65a9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingImageUnitsTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingImageUnitsTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.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..9da0772b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLength.g.cs @@ -84,5 +84,6 @@ public ModelPricingInputCharacterLength( public ModelPricingInputCharacterLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs index ed491051..5f84d8c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLengthFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputCharacterLengthFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLengthFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b420d138..3628379b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.Json.g.cs index 2e6f124b..d9df110f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputCharacterLengthShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputCharacterLengthShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputCharacterLengthShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 94aed5ed..6de01b22 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable.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..c197dc4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputCharacterLengthTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputCharacterLengthTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.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..85f90233 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLength.g.cs @@ -84,5 +84,6 @@ public ModelPricingInputLength( public ModelPricingInputLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs index 1d0ba7f9..0bfe694c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputLengthFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputLengthFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLengthFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9e951b8c..9be7de7f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.Json.g.cs index b3a12438..86aa6a8c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputLengthShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputLengthShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputLengthShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 5d517e47..89e1618d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable.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..13da2c52 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputLengthTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputLengthTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.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..797f9038 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokens.g.cs @@ -84,5 +84,6 @@ public ModelPricingInputTokens( public ModelPricingInputTokens() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs index 48b1998c..4feec869 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokensFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputTokensFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokensFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1cdf4a6d..80b375cb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.Json.g.cs index 8747f507..653a6a10 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingInputTokensShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingInputTokensShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingInputTokensShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 95aea410..5979daaa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable.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..07b8bb7d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingInputTokensTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingInputTokensTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.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..5ba97c50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLength.g.cs @@ -84,5 +84,6 @@ public ModelPricingOutputLength( public ModelPricingOutputLength() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs index 8ac79796..f52d3c16 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLengthFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingOutputLengthFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLengthFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c87e9e9a..7a8d5d2a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.Json.g.cs index 49eb648d..5e4a7aa0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingOutputLengthShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingOutputLengthShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingOutputLengthShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8de949dc..39c38969 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable.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..6249751d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingOutputLengthTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingOutputLengthTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.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..a6efe9d0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTime.g.cs @@ -84,5 +84,6 @@ public ModelPricingTime( public ModelPricingTime() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs index 0a24ea25..7030b1ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTimeFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTimeFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTimeFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 20a609d0..9de6e894 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.Json.g.cs index b15139d8..f80f9e71 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTimeShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTimeShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTimeShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 35a5fd37..56c96a20 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable.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..e3920550 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTimeTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTimeTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.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..befd92e3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokens.g.cs @@ -112,5 +112,6 @@ public ModelPricingTokens( public ModelPricingTokens() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs index 5aa0c127..4b7a8636 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokensFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 78b2d75f..16bf74f4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs index c4c24bb6..1919549d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCacheWrite; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensRatePerInputTokenCacheWrite? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCacheWrite; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 16b435a3..ca2b7714 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCacheWrite.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensRatePerInputTokenCacheWrite /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.Json.g.cs index bebd9d7b..6c92945e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCached; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensRatePerInputTokenCached? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensRatePerInputTokenCached; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7ab1fb8a..c0b4b0aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensRatePerInputTokenCached.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensRatePerInputTokenCached /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.Json.g.cs index b9afd1ad..c63f19e3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingTokensShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingTokensShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingTokensShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7bf44e66..7f1daf74 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable.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..1a1ffd4c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingTokensTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingTokensTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.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..515b40c2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptime.g.cs @@ -84,5 +84,6 @@ public ModelPricingUptime( public ModelPricingUptime() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs index e508212b..7933160a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingUptimeFull; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingUptimeFull? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptimeFull; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ae56eef8..26eb84e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeFull.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeFull /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.Json.g.cs index 8b4b9132..ba8a6b20 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPricingUptimeShort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPricingUptimeShort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPricingUptimeShort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 05516964..70b66cc7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeShort.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeShort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable.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..7d3b1ec9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPricingUptimeTable2.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPricingUptimeTable2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.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..76a3f2cd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityIn.g.cs @@ -42,5 +42,6 @@ public ModelPublicityIn( public ModelPublicityIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.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..0d2b92d3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPublicityModelsModelNamePublicityPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXApiKey.Json.g.cs new file mode 100644 index 00000000..98db2bc5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelPublicityModelsModelNamePublicityPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelPublicityModelsModelNamePublicityPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXApiKey? 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.ModelPublicityModelsModelNamePublicityPostXApiKey? 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.ModelPublicityModelsModelNamePublicityPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelPublicityModelsModelNamePublicityPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXApiKey.g.cs new file mode 100644 index 00000000..2e72cbcc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelPublicityModelsModelNamePublicityPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index ccfa5296..61ce80a8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelPublicityModelsModelNamePublicityPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c38c4684..3f22b86f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelPublicityModelsModelNamePublicityPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelPublicityModelsModelNamePublicityPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs index 84739882..cf3aaf7e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0629f9a5..fb02e448 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey.Json.g.cs new file mode 100644 index 00000000..81c4cf63 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey? 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey? 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.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey.g.cs new file mode 100644 index 00000000..e4768a0a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 37369ef8..c0da0ae3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0054485a..a234d853 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelSchemaModelsModelNameSchemaVariantKeyGetXiApiKe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.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..c2173957 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionOut.g.cs @@ -66,5 +66,6 @@ public ModelVersionOut( public ModelVersionOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..ce406a50 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelVersionsModelsModelNameVersionsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelVersionsModelsModelNameVersionsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXApiKey? 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.ModelVersionsModelsModelNameVersionsGetXApiKey? 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.ModelVersionsModelsModelNameVersionsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelVersionsModelsModelNameVersionsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXApiKey.g.cs new file mode 100644 index 00000000..e56a3ec1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelVersionsModelsModelNameVersionsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index fa520ecd..8683a44e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelVersionsModelsModelNameVersionsGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d9ff29eb..77801d85 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelVersionsModelsModelNameVersionsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelVersionsModelsModelNameVersionsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXApiKey.Json.g.cs new file mode 100644 index 00000000..7f9830fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelsDeploymentListModelsDeploymentListGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelsDeploymentListModelsDeploymentListGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXApiKey? 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.ModelsDeploymentListModelsDeploymentListGetXApiKey? 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.ModelsDeploymentListModelsDeploymentListGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelsDeploymentListModelsDeploymentListGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXApiKey.g.cs new file mode 100644 index 00000000..a8893cea --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelsDeploymentListModelsDeploymentListGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 1a36a8b5..abefc756 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsDeploymentListModelsDeploymentListGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 11309c1b..945d197a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsDeploymentListModelsDeploymentListGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelsDeploymentListModelsDeploymentListGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.Json.g.cs index a72f4132..d5758959 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelsInfoModelsModelNameGetVersion; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelsInfoModelsModelNameGetVersion? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsInfoModelsModelNameGetVersion; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1fc7a314..dbfd266e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetVersion.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelsInfoModelsModelNameGetVersion /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXApiKey.Json.g.cs new file mode 100644 index 00000000..ce5c8990 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class ModelsInfoModelsModelNameGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.ModelsInfoModelsModelNameGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.ModelsInfoModelsModelNameGetXApiKey), + jsonSerializerContext) as global::DeepInfra.ModelsInfoModelsModelNameGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelsInfoModelsModelNameGetXApiKey? 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.ModelsInfoModelsModelNameGetXApiKey? 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.ModelsInfoModelsModelNameGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsInfoModelsModelNameGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.ModelsInfoModelsModelNameGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXApiKey.g.cs new file mode 100644 index 00000000..8653d93a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class ModelsInfoModelsModelNameGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 6657da12..6da7d53c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ModelsInfoModelsModelNameGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ModelsInfoModelsModelNameGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ModelsInfoModelsModelNameGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 9fa3fbcf..d554c7cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ModelsInfoModelsModelNameGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class ModelsInfoModelsModelNameGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.Json.g.cs index a047a458..f80e59b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OktaLoginOktaLoginGetLoginId; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OktaLoginOktaLoginGetLoginId? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OktaLoginOktaLoginGetLoginId; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index dd1ea94d..1ef00668 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetLoginId.g.cs @@ -14,5 +14,6 @@ public sealed partial class OktaLoginOktaLoginGetLoginId /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.Json.g.cs index 9780753f..03ce1380 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OktaLoginOktaLoginGetOrigin; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OktaLoginOktaLoginGetOrigin? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OktaLoginOktaLoginGetOrigin; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 14786d7e..41fcb10e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetOrigin.g.cs @@ -14,5 +14,6 @@ public sealed partial class OktaLoginOktaLoginGetOrigin /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.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..43d85e2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OktaLoginOktaLoginGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OktaLoginOktaLoginGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatch.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..d74ab67d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesIn.g.cs @@ -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..27b5012d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInEndpoint.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInEndpoint.g.cs @@ -4,7 +4,7 @@ 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 { @@ -16,6 +16,10 @@ public enum OpenAIBatchesInEndpoint /// /// 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..a0b70621 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesInMetadata2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIBatchesInMetadata2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..486ccad6 --- /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.OpenAIBatchesOutCancelledAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancelledAt.Json.g.cs new file mode 100644 index 00000000..491c2f4d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancelledAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutCancelledAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutCancelledAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutCancelledAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutCancelledAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutCancelledAt? 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.OpenAIBatchesOutCancelledAt? 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.OpenAIBatchesOutCancelledAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutCancelledAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutCancelledAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancelledAt.g.cs new file mode 100644 index 00000000..12eca3ba --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancelledAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch was cancelled. + /// + public sealed partial class OpenAIBatchesOutCancelledAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancellingAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancellingAt.Json.g.cs new file mode 100644 index 00000000..bc74ca03 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancellingAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutCancellingAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutCancellingAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutCancellingAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutCancellingAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutCancellingAt? 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.OpenAIBatchesOutCancellingAt? 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.OpenAIBatchesOutCancellingAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutCancellingAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutCancellingAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancellingAt.g.cs new file mode 100644 index 00000000..d5ab9368 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCancellingAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch started cancelling. + /// + public sealed partial class OpenAIBatchesOutCancellingAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCompletedAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCompletedAt.Json.g.cs new file mode 100644 index 00000000..2e9595d9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCompletedAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutCompletedAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutCompletedAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutCompletedAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutCompletedAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutCompletedAt? 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.OpenAIBatchesOutCompletedAt? 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.OpenAIBatchesOutCompletedAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutCompletedAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutCompletedAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCompletedAt.g.cs new file mode 100644 index 00000000..ca4efbc9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutCompletedAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch completed. + /// + public sealed partial class OpenAIBatchesOutCompletedAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrorFileId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrorFileId.Json.g.cs new file mode 100644 index 00000000..bb4e55fb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrorFileId.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutErrorFileId + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutErrorFileId? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutErrorFileId), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutErrorFileId; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutErrorFileId? 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.OpenAIBatchesOutErrorFileId? 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.OpenAIBatchesOutErrorFileId), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutErrorFileId; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutErrorFileId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrorFileId.g.cs new file mode 100644 index 00000000..8906d5f1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutErrorFileId.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The ID of the error file. + /// + public sealed partial class OpenAIBatchesOutErrorFileId + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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.OpenAIBatchesOutExpiredAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutExpiredAt.Json.g.cs new file mode 100644 index 00000000..a88fcbcd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutExpiredAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutExpiredAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutExpiredAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutExpiredAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutExpiredAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutExpiredAt? 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.OpenAIBatchesOutExpiredAt? 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.OpenAIBatchesOutExpiredAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutExpiredAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutExpiredAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutExpiredAt.g.cs new file mode 100644 index 00000000..7c5b136b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutExpiredAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch expired. + /// + public sealed partial class OpenAIBatchesOutExpiredAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFailedAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFailedAt.Json.g.cs new file mode 100644 index 00000000..4cc0b680 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFailedAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutFailedAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutFailedAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutFailedAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutFailedAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutFailedAt? 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.OpenAIBatchesOutFailedAt? 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.OpenAIBatchesOutFailedAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutFailedAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutFailedAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFailedAt.g.cs new file mode 100644 index 00000000..8d40b872 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFailedAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch failed. + /// + public sealed partial class OpenAIBatchesOutFailedAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFinalizingAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFinalizingAt.Json.g.cs new file mode 100644 index 00000000..9c8ff006 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFinalizingAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutFinalizingAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutFinalizingAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutFinalizingAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutFinalizingAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutFinalizingAt? 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.OpenAIBatchesOutFinalizingAt? 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.OpenAIBatchesOutFinalizingAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutFinalizingAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutFinalizingAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFinalizingAt.g.cs new file mode 100644 index 00000000..96dbfbc9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutFinalizingAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch started finalizing. + /// + public sealed partial class OpenAIBatchesOutFinalizingAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutInProgressAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutInProgressAt.Json.g.cs new file mode 100644 index 00000000..2c62d12a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutInProgressAt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutInProgressAt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutInProgressAt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutInProgressAt), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutInProgressAt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutInProgressAt? 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.OpenAIBatchesOutInProgressAt? 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.OpenAIBatchesOutInProgressAt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutInProgressAt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutInProgressAt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutInProgressAt.g.cs new file mode 100644 index 00000000..4b7fd009 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutInProgressAt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The Unix timestamp of when the batch started processing. + /// + public sealed partial class OpenAIBatchesOutInProgressAt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..5bf53d50 --- /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.OpenAIBatchesOutModel.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutModel.Json.g.cs new file mode 100644 index 00000000..1f8dd5b6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutModel.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutModel + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutModel? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutModel), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutModel; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutModel? 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.OpenAIBatchesOutModel? 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.OpenAIBatchesOutModel), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutModel; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutModel.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutModel.g.cs new file mode 100644 index 00000000..617a9dec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutModel.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The model used for the batch. + /// + public sealed partial class OpenAIBatchesOutModel + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutOutputFileId.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutOutputFileId.Json.g.cs new file mode 100644 index 00000000..8d8438a8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutOutputFileId.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIBatchesOutOutputFileId + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIBatchesOutOutputFileId? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIBatchesOutOutputFileId), + jsonSerializerContext) as global::DeepInfra.OpenAIBatchesOutOutputFileId; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIBatchesOutOutputFileId? 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.OpenAIBatchesOutOutputFileId? 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.OpenAIBatchesOutOutputFileId), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIBatchesOutOutputFileId; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIBatchesOutOutputFileId.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutOutputFileId.g.cs new file mode 100644 index 00000000..80f21c58 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIBatchesOutOutputFileId.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// The ID of the output file. + /// + public sealed partial class OpenAIBatchesOutOutputFileId + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..f3fdfa20 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs @@ -8,6 +8,12 @@ namespace DeepInfra /// public sealed partial class OpenAIChatCompletionsIn { + /// + /// 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). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + /// /// model name /// @@ -71,6 +77,12 @@ public sealed partial class OpenAIChatCompletionsIn [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter, object>))] public global::DeepInfra.AnyOf, object>? Stop { get; set; } + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stop_token_ids")] + public global::System.Collections.Generic.IList? StopTokenIds { get; set; } + /// /// number of sequences to return
/// Default Value: 1 @@ -144,7 +156,7 @@ public sealed partial class OpenAIChatCompletionsIn public global::DeepInfra.StreamOptions? StreamOptions { get; set; } /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. /// [global::System.Text.Json.Serialization.JsonPropertyName("reasoning_effort")] public global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? ReasoningEffort { get; set; } @@ -167,6 +179,12 @@ public sealed partial class OpenAIChatCompletionsIn [global::System.Text.Json.Serialization.JsonPropertyName("chat_template_kwargs")] public object? ChatTemplateKwargs { get; set; } + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("continue_final_message")] + public bool? ContinueFinalMessage { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -182,6 +200,9 @@ public sealed partial class OpenAIChatCompletionsIn /// /// conversation messages: (user,assistant,tool)*,user including one system message anywhere /// + /// + /// 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). + /// /// /// whether to stream the output via SSE or return the full response
/// Default Value: false @@ -209,6 +230,9 @@ public sealed partial class OpenAIChatCompletionsIn /// /// up to 16 sequences where the API will stop generating further tokens /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// /// /// number of sequences to return
/// Default Value: 1 @@ -247,7 +271,7 @@ public sealed partial class OpenAIChatCompletionsIn /// streaming options /// /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. /// /// /// Reasoning configuration. @@ -258,12 +282,16 @@ public sealed partial class OpenAIChatCompletionsIn /// /// Chat template kwargs. /// + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public OpenAIChatCompletionsIn( string model, global::System.Collections.Generic.IList> messages, + global::DeepInfra.ServiceTier? serviceTier, bool? stream, double? temperature, double? topP, @@ -271,6 +299,7 @@ public OpenAIChatCompletionsIn( int? topK, int? maxTokens, global::DeepInfra.AnyOf, object>? stop, + global::System.Collections.Generic.IList? stopTokenIds, int? n, double? presencePenalty, double? frequencyPenalty, @@ -285,8 +314,10 @@ public OpenAIChatCompletionsIn( global::DeepInfra.OpenAIChatCompletionsInReasoningEffort2? reasoningEffort, global::DeepInfra.ChatReasoningSettings? reasoning, string? promptCacheKey, - object? chatTemplateKwargs) + object? chatTemplateKwargs, + bool? continueFinalMessage) { + this.ServiceTier = serviceTier; 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 +327,7 @@ public OpenAIChatCompletionsIn( this.TopK = topK; this.MaxTokens = maxTokens; this.Stop = stop; + this.StopTokenIds = stopTokenIds; this.N = n; this.PresencePenalty = presencePenalty; this.FrequencyPenalty = frequencyPenalty; @@ -311,6 +343,7 @@ public OpenAIChatCompletionsIn( this.Reasoning = reasoning; this.PromptCacheKey = promptCacheKey; this.ChatTemplateKwargs = chatTemplateKwargs; + this.ContinueFinalMessage = continueFinalMessage; } /// @@ -319,5 +352,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..9b53296c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInChatTemplateKwargs2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInChatTemplateKwargs2 ///
[global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.Json.g.cs new file mode 100644 index 00000000..b47b0ec7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIChatCompletionsInContinueFinalMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenAIChatCompletionsInContinueFinalMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage), + jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage? 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.OpenAIChatCompletionsInContinueFinalMessage? 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.OpenAIChatCompletionsInContinueFinalMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInContinueFinalMessage; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIChatCompletionsInContinueFinalMessage.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.g.cs new file mode 100644 index 00000000..49af9191 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInContinueFinalMessage.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message. + /// + public sealed partial class OpenAIChatCompletionsInContinueFinalMessage + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.Json.g.cs index eb8ff796..d3697fb3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInLogprobs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInLogprobs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInLogprobs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2f58cf26..e582e0b7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInLogprobs.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInLogprobs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.Json.g.cs index 12a9fb7a..4d1304be 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInMaxTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInMaxTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInMaxTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 5dab1141..3fc654aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInMaxTokens.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAIChatCompletionsInMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs index f01e015e..f72e0612 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInPromptCacheKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInPromptCacheKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInPromptCacheKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 55925ad0..c5b2dfdc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInPromptCacheKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInPromptCacheKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoning.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 index 2a653f1e..2b9b5d8e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInReasoningEffort; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInReasoningEffort? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInReasoningEffort; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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..6385061c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. + /// Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports. /// public sealed partial class OpenAIChatCompletionsInReasoningEffort { @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInReasoningEffort /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs index c1afff0c..527d4759 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInReasoningEffort2.g.cs @@ -24,6 +24,10 @@ public enum OpenAIChatCompletionsInReasoningEffort2 /// /// None, + /// + /// + /// + Xhigh, } /// @@ -42,6 +46,7 @@ public static string ToValueString(this OpenAIChatCompletionsInReasoningEffort2 OpenAIChatCompletionsInReasoningEffort2.Low => "low", OpenAIChatCompletionsInReasoningEffort2.Medium => "medium", OpenAIChatCompletionsInReasoningEffort2.None => "none", + OpenAIChatCompletionsInReasoningEffort2.Xhigh => "xhigh", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), }; } @@ -56,6 +61,7 @@ public static string ToValueString(this OpenAIChatCompletionsInReasoningEffort2 "low" => OpenAIChatCompletionsInReasoningEffort2.Low, "medium" => OpenAIChatCompletionsInReasoningEffort2.Medium, "none" => OpenAIChatCompletionsInReasoningEffort2.None, + "xhigh" => OpenAIChatCompletionsInReasoningEffort2.Xhigh, _ => null, }; } diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs index dc82db2b..2485c19e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInSeed; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInSeed? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInSeed; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0075abde..95e16b42 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInSeed.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInSeed /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInServiceTier.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInServiceTier.Json.g.cs new file mode 100644 index 00000000..f777cc85 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInServiceTier.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIChatCompletionsInServiceTier + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIChatCompletionsInServiceTier? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIChatCompletionsInServiceTier), + jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInServiceTier; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInServiceTier? 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.OpenAIChatCompletionsInServiceTier? 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.OpenAIChatCompletionsInServiceTier), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInServiceTier; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIChatCompletionsInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInServiceTier.g.cs new file mode 100644 index 00000000..e527308e --- /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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + 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.OpenAIChatCompletionsInStopTokenIds.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.Json.g.cs new file mode 100644 index 00000000..dc985818 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIChatCompletionsInStopTokenIds + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenAIChatCompletionsInStopTokenIds? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIChatCompletionsInStopTokenIds), + jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInStopTokenIds; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInStopTokenIds? 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.OpenAIChatCompletionsInStopTokenIds? 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.OpenAIChatCompletionsInStopTokenIds), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInStopTokenIds; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAIChatCompletionsInStopTokenIds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.g.cs new file mode 100644 index 00000000..758dc8cb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStopTokenIds.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + public sealed partial class OpenAIChatCompletionsInStopTokenIds + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInStreamOptions.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.OpenAIChatCompletionsInTools.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.Json.g.cs index 06a91504..d4385121 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInTools; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInTools? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInTools; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 878ca8ac..47a00465 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInTools.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInTools /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.Json.g.cs index 0413e07c..b7bf98a3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIChatCompletionsInUser; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIChatCompletionsInUser? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIChatCompletionsInUser; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ac5509fa..c23907ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIChatCompletionsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.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..931f50be 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsIn.g.cs @@ -8,6 +8,12 @@ namespace DeepInfra /// public sealed partial class OpenAICompletionsIn { + /// + /// 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). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("service_tier")] + public global::DeepInfra.ServiceTier? ServiceTier { get; set; } + /// /// model name /// @@ -138,7 +144,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; } @@ -176,6 +182,9 @@ public sealed partial class OpenAICompletionsIn /// /// input prompt - a single string is currently supported /// + /// + /// 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 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. @@ -238,7 +247,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 @@ -255,6 +264,7 @@ public sealed partial class OpenAICompletionsIn public OpenAICompletionsIn( string model, global::DeepInfra.AnyOf> prompt, + global::DeepInfra.ServiceTier? serviceTier, int? maxTokens, double? temperature, double? topP, @@ -277,6 +287,7 @@ public OpenAICompletionsIn( string? promptCacheKey, global::DeepInfra.CompletionMultiModalData? data) { + this.ServiceTier = serviceTier; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Prompt = prompt; this.MaxTokens = maxTokens; @@ -308,5 +319,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 index 87afdfbc..375d5d02 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInEcho; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInEcho? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInEcho; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7cf28c05..d9781dcc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInEcho.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInEcho /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.Json.g.cs index 2be66795..46248e22 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInLogprobs; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInLogprobs? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInLogprobs; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 5e7f5079..3b596cc5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInLogprobs.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInLogprobs /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.Json.g.cs index 06e18359..0b433bc6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInMaxTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInMaxTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInMaxTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index ba51ef8c..3a2d6c31 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInMaxTokens.g.cs @@ -15,5 +15,6 @@ public sealed partial class OpenAICompletionsInMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.Json.g.cs index a9a697c9..065a8ede 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInPromptCacheKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInPromptCacheKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInPromptCacheKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a14d4a72..46c995ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInPromptCacheKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInPromptCacheKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs index 40e06105..4ac45fa8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInReturnTokensAsTokenIds; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInReturnTokensAsTokenIds? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInReturnTokensAsTokenIds; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 058e6012..bb5e938a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInReturnTokensAsTokenIds.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInReturnTokensAsTokenIds /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.Json.g.cs index 22b4f96a..c3daabb4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInSeed; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInSeed? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInSeed; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 87b688e4..8e515c26 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInSeed.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInSeed /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInServiceTier.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInServiceTier.Json.g.cs new file mode 100644 index 00000000..fa67ec03 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInServiceTier.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAICompletionsInServiceTier + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAICompletionsInServiceTier? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAICompletionsInServiceTier), + jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInServiceTier; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInServiceTier? 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.OpenAICompletionsInServiceTier? 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.OpenAICompletionsInServiceTier), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInServiceTier; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenAICompletionsInServiceTier.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInServiceTier.g.cs new file mode 100644 index 00000000..769d6dda --- /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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + 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 index 78e74eba..80285109 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInStopTokenIds; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInStopTokenIds? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInStopTokenIds; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 89c15069..66390bef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStopTokenIds.g.cs @@ -4,7 +4,7 @@ namespace DeepInfra { /// - /// List of token IDs that will stop generation when encountered + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. /// public sealed partial class OpenAICompletionsInStopTokenIds { @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInStopTokenIds /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInStreamOptions.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 index 6db47efc..25c8b4e9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAICompletionsInUser; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAICompletionsInUser? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAICompletionsInUser; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 90151fa9..6b9a1cf3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAICompletionsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAICompletionsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.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..d8d0626f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.cs @@ -22,12 +22,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,11 +62,14 @@ 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). /// + /// + /// 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 @@ -73,14 +82,16 @@ public sealed partial class OpenAIEmbeddingsIn #endif public OpenAIEmbeddingsIn( string model, - global::DeepInfra.AnyOf, string> input, + global::DeepInfra.AnyOf>>> input, global::DeepInfra.ServiceTier? serviceTier, + global::DeepInfra.OpenAIEmbeddingsInInputType2? inputType, global::DeepInfra.OpenAIEmbeddingsInEncodingFormat? encodingFormat, int? dimensions) { this.ServiceTier = serviceTier; this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Input = input; + this.InputType = inputType; this.EncodingFormat = encodingFormat; this.Dimensions = dimensions; } @@ -91,5 +102,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 index 51e44eb3..61c5a784 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsInDimensions; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIEmbeddingsInDimensions? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsInDimensions; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0288ed29..81d3f371 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInDimensions.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIEmbeddingsInDimensions ///
[global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType.Json.g.cs new file mode 100644 index 00000000..24f52659 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInInputType.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenAIEmbeddingsInInputType + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenAIEmbeddingsInInputType? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenAIEmbeddingsInInputType), + jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsInInputType; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIEmbeddingsInInputType? 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.OpenAIEmbeddingsInInputType? 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.OpenAIEmbeddingsInInputType), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsInInputType; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.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..3ba0c9ff --- /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..957b42ac --- /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..8ef6dd18 --- /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 index bf913347..786ed3cc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIEmbeddingsInServiceTier; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIEmbeddingsInServiceTier? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIEmbeddingsInServiceTier; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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..6d466873 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsInServiceTier.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIEmbeddingsInServiceTier /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..bff3b7b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIFile.g.cs @@ -0,0 +1,96 @@ + +#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; } + + /// + /// Additional properties that are not explicitly defined 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, + 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; + } + + /// + /// 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..63c4bee5 --- /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..32d78a2d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageData.g.cs @@ -63,5 +63,6 @@ public OpenAIImageData( public OpenAIImageData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs index 2112011b..980f931e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImageDataB64Json; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImageDataB64Json? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageDataB64Json; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8ef9ee50..aa17df2a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataB64Json.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImageDataB64Json /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.Json.g.cs index 33359d96..0323334f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImageDataRevisedPrompt; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImageDataRevisedPrompt? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageDataRevisedPrompt; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8630b6ed..dc035a34 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataRevisedPrompt.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImageDataRevisedPrompt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.Json.g.cs index b1be6299..aac16bf2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImageDataUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImageDataUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImageDataUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 80178a45..22481adb 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImageDataUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImageDataUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.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..7ba57268 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsIn.g.cs @@ -150,5 +150,6 @@ public OpenAIImagesEditsIn( public OpenAIImagesEditsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs index 2c18bb62..0381fad8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsInMask; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesEditsInMask? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsInMask; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f6e960ea..09ed5c41 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInMask.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesEditsInMask /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.Json.g.cs index c2b04ba6..1d30b692 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsInResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesEditsInResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsInResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4780576e..b97c8392 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesEditsInUser; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesEditsInUser? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesEditsInUser; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 11e0fc82..612373a8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesEditsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesEditsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.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..5aaf2ded 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsIn.g.cs @@ -126,5 +126,6 @@ public OpenAIImagesGenerationsIn( public OpenAIImagesGenerationsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs index b2d55370..aaa570b1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInQuality; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesGenerationsInQuality? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInQuality; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 87c00f8e..83feeaa0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInQuality.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesGenerationsInQuality /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.Json.g.cs index cb39d142..a3cf1696 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesGenerationsInResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b763207c..f572d28e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInStyle; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesGenerationsInStyle? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInStyle; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 21ba2e38..487d71d3 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInStyle.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesGenerationsInStyle /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.Json.g.cs index d22201ed..b49a88d5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesGenerationsInUser; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesGenerationsInUser? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesGenerationsInUser; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3db81b9a..c1a058ac 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesGenerationsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesGenerationsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.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..d9c25438 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesOut.g.cs @@ -54,5 +54,6 @@ public OpenAIImagesOut( public OpenAIImagesOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.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..ccf8db22 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsIn.g.cs @@ -116,5 +116,6 @@ public OpenAIImagesVariationsIn( public OpenAIImagesVariationsIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs index c60a58df..fc92ae29 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInResponseFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesVariationsInResponseFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesVariationsInResponseFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesVariationsInResponseFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0a2d8aa7..2273f580 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAIImagesVariationsInUser; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAIImagesVariationsInUser? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAIImagesVariationsInUser; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d145adf9..3f78fb57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIImagesVariationsInUser.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIImagesVariationsInUser /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.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..3201e3a5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.cs @@ -99,5 +99,6 @@ public OpenAIModelOut( public OpenAIModelOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.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..db67748f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOutMetadata.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAIModelOutMetadata /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.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..facf2d8f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelsOut.g.cs @@ -50,5 +50,6 @@ public OpenAIModelsOut( public OpenAIModelsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.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..5717def7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechIn.g.cs @@ -114,5 +114,6 @@ public OpenAITextToSpeechIn( public OpenAITextToSpeechIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody.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..f30ac6ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInExtraBody2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInExtraBody2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.Json.g.cs index bd814680..b6a6ec3b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechInServiceTier; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAITextToSpeechInServiceTier? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechInServiceTier; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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..1e97a0de 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInServiceTier.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInServiceTier /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.Json.g.cs index 2784745d..9f932a38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenAITextToSpeechInVoice; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenAITextToSpeechInVoice? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenAITextToSpeechInVoice; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 42363541..d0ee6ef6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAITextToSpeechInVoice.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenAITextToSpeechInVoice /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.Json.g.cs new file mode 100644 index 00000000..76905694 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawAgentTypeMetaOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawAgentTypeMetaOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawAgentTypeMetaOut), + jsonSerializerContext) as global::DeepInfra.OpenClawAgentTypeMetaOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawAgentTypeMetaOut? 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.OpenClawAgentTypeMetaOut? 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.OpenClawAgentTypeMetaOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawAgentTypeMetaOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawAgentTypeMetaOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.g.cs new file mode 100644 index 00000000..5ef09097 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawAgentTypeMetaOut.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawAgentTypeMetaOut + { + /// + /// Human-readable display name for the framework + /// + [global::System.Text.Json.Serialization.JsonPropertyName("pretty_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string PrettyName { get; set; } + + /// + /// Agent framework version + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Version { get; set; } + + /// + /// Whether instances of this framework expose a dashboard via the nginx proxy. False -> SSH-only; the UI should hide the dashboard launch affordance and surface the SSH connection string instead. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("has_dashboard")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool HasDashboard { get; set; } + + /// + /// Plans available for this agent type + /// + [global::System.Text.Json.Serialization.JsonPropertyName("plans")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Plans { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable display name for the framework + /// + /// + /// Agent framework version + /// + /// + /// Whether instances of this framework expose a dashboard via the nginx proxy. False -> SSH-only; the UI should hide the dashboard launch affordance and surface the SSH connection string instead. + /// + /// + /// Plans available for this agent type + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawAgentTypeMetaOut( + string prettyName, + string version, + bool hasDashboard, + global::System.Collections.Generic.IList plans) + { + this.PrettyName = prettyName ?? throw new global::System.ArgumentNullException(nameof(prettyName)); + this.Version = version ?? throw new global::System.ArgumentNullException(nameof(version)); + this.HasDashboard = hasDashboard; + this.Plans = plans ?? throw new global::System.ArgumentNullException(nameof(plans)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawAgentTypeMetaOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.Json.g.cs new file mode 100644 index 00000000..8f972e66 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawBackupOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawBackupOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawBackupOut), + jsonSerializerContext) as global::DeepInfra.OpenClawBackupOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawBackupOut? 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.OpenClawBackupOut? 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.OpenClawBackupOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawBackupOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawBackupOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.g.cs new file mode 100644 index 00000000..d45955fa --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawBackupOut.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawBackupOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("snapshot_name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string SnapshotName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("size_in_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int SizeInGb { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string State { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at_unix")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int CreatedAtUnix { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawBackupOut( + string snapshotName, + int sizeInGb, + string state, + int createdAtUnix) + { + this.SnapshotName = snapshotName ?? throw new global::System.ArgumentNullException(nameof(snapshotName)); + this.SizeInGb = sizeInGb; + this.State = state ?? throw new global::System.ArgumentNullException(nameof(state)); + this.CreatedAtUnix = createdAtUnix; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawBackupOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.Json.g.cs new file mode 100644 index 00000000..27d859a7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawCatalogOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawCatalogOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawCatalogOut), + jsonSerializerContext) as global::DeepInfra.OpenClawCatalogOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawCatalogOut? 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.OpenClawCatalogOut? 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.OpenClawCatalogOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawCatalogOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawCatalogOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.g.cs new file mode 100644 index 00000000..8da0c9d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCatalogOut.g.cs @@ -0,0 +1,20 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Per-agent-type catalog: keyed by agent_type_id, each entry carries the
+ /// current version and the plans available for that type. + ///
+ public sealed partial class OpenClawCatalogOut + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.Json.g.cs new file mode 100644 index 00000000..faf5dd35 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawCreateIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawCreateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawCreateIn), + jsonSerializerContext) as global::DeepInfra.OpenClawCreateIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawCreateIn? 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.OpenClawCreateIn? 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.OpenClawCreateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawCreateIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawCreateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.g.cs new file mode 100644 index 00000000..b66e4124 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateIn.g.cs @@ -0,0 +1,73 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawCreateIn + { + /// + /// Instance name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Agent type identifier
+ /// Default Value: openclaw + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("agent_type_id")] + public string? AgentTypeId { get; set; } + + /// + /// Plan identifier
+ /// Default Value: standard + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("plan_id")] + public string? PlanId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Instance name + /// + /// + /// Agent type identifier
+ /// Default Value: openclaw + /// + /// + /// Plan identifier
+ /// Default Value: standard + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawCreateIn( + string name, + string? agentTypeId, + string? planId) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.AgentTypeId = agentTypeId; + this.PlanId = planId; + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawCreateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.Json.g.cs new file mode 100644 index 00000000..54bd1029 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawCreateOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawCreateOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawCreateOut), + jsonSerializerContext) as global::DeepInfra.OpenClawCreateOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawCreateOut? 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.OpenClawCreateOut? 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.OpenClawCreateOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawCreateOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawCreateOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.g.cs new file mode 100644 index 00000000..f68342fe --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawCreateOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawCreateOut + { + /// + /// Instance ID + /// + [global::System.Text.Json.Serialization.JsonPropertyName("instance_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string InstanceId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Instance ID + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawCreateOut( + string instanceId) + { + this.InstanceId = instanceId ?? throw new global::System.ArgumentNullException(nameof(instanceId)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawCreateOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.Json.g.cs new file mode 100644 index 00000000..17f1d224 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawInstanceOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOut), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOut? 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.OpenClawInstanceOut? 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.OpenClawInstanceOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawInstanceOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.g.cs new file mode 100644 index 00000000..84a832dd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOut.g.cs @@ -0,0 +1,193 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOut + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AgentInstanceStateJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::DeepInfra.AgentInstanceState State { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("start_ts")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int StartTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("state_ts")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int StateTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stop_ts")] + public int? StopTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("price_per_hour")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double PricePerHour { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("region")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Region { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("last_backup_ts")] + public int? LastBackupTs { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ssh_port")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int SshPort { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("fail_reason")] + public string? FailReason { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("public_ip")] + public string? PublicIp { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + public string? Version { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agent_type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentType { get; set; } + + /// + /// 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 OpenClawInstanceOut( + 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 OpenClawInstanceOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.Json.g.cs new file mode 100644 index 00000000..05ccb1da --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutFailReason + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawInstanceOutFailReason? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutFailReason), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutFailReason; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutFailReason? 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.OpenClawInstanceOutFailReason? 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.OpenClawInstanceOutFailReason), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutFailReason; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawInstanceOutFailReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.g.cs new file mode 100644 index 00000000..048b4fae --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutFailReason.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutFailReason + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.Json.g.cs new file mode 100644 index 00000000..fd3ef0d0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutLastBackupTs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawInstanceOutLastBackupTs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutLastBackupTs), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutLastBackupTs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutLastBackupTs? 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.OpenClawInstanceOutLastBackupTs? 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.OpenClawInstanceOutLastBackupTs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutLastBackupTs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawInstanceOutLastBackupTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.g.cs new file mode 100644 index 00000000..4e327fa3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutLastBackupTs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutLastBackupTs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.Json.g.cs new file mode 100644 index 00000000..6f94801a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutPublicIp + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawInstanceOutPublicIp? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutPublicIp), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutPublicIp; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutPublicIp? 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.OpenClawInstanceOutPublicIp? 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.OpenClawInstanceOutPublicIp), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutPublicIp; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawInstanceOutPublicIp.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.g.cs new file mode 100644 index 00000000..1c006e66 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutPublicIp.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutPublicIp + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.Json.g.cs new file mode 100644 index 00000000..efcdc4be --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutStopTs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawInstanceOutStopTs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutStopTs), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutStopTs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutStopTs? 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.OpenClawInstanceOutStopTs? 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.OpenClawInstanceOutStopTs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutStopTs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawInstanceOutStopTs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.g.cs new file mode 100644 index 00000000..876828ab --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutStopTs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutStopTs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.Json.g.cs new file mode 100644 index 00000000..595d62c3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawInstanceOutVersion + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawInstanceOutVersion? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawInstanceOutVersion), + jsonSerializerContext) as global::DeepInfra.OpenClawInstanceOutVersion; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawInstanceOutVersion? 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.OpenClawInstanceOutVersion? 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.OpenClawInstanceOutVersion), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawInstanceOutVersion; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawInstanceOutVersion.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.g.cs new file mode 100644 index 00000000..2810f91f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawInstanceOutVersion.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawInstanceOutVersion + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.Json.g.cs new file mode 100644 index 00000000..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..2b0a5822 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawLaunchTokenOut.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawLaunchTokenOut + { + /// + /// Single-use URL that opens the dashboard. Short TTL; mint right before navigating. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("dashboard_url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string DashboardUrl { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Single-use URL that opens the dashboard. Short TTL; mint right before navigating. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawLaunchTokenOut( + string dashboardUrl) + { + this.DashboardUrl = dashboardUrl ?? throw new global::System.ArgumentNullException(nameof(dashboardUrl)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawLaunchTokenOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.Json.g.cs new file mode 100644 index 00000000..75b17098 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawPlanOut + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawPlanOut? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawPlanOut), + jsonSerializerContext) as global::DeepInfra.OpenClawPlanOut; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawPlanOut? 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.OpenClawPlanOut? 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.OpenClawPlanOut), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawPlanOut; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawPlanOut.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.g.cs new file mode 100644 index 00000000..d9a8252e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawPlanOut.g.cs @@ -0,0 +1,95 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawPlanOut + { + /// + /// Plan identifier + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Number of vCPUs + /// + [global::System.Text.Json.Serialization.JsonPropertyName("vcpu")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Vcpu { get; set; } + + /// + /// RAM in GB + /// + [global::System.Text.Json.Serialization.JsonPropertyName("ram_gb")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int RamGb { get; set; } + + /// + /// Price in USD per hour + /// + [global::System.Text.Json.Serialization.JsonPropertyName("price_per_hour")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double PricePerHour { get; set; } + + /// + /// 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 OpenClawPlanOut( + 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 OpenClawPlanOut() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.Json.g.cs new file mode 100644 index 00000000..70b4fe21 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenClawUpdateIn + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenClawUpdateIn? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenClawUpdateIn), + jsonSerializerContext) as global::DeepInfra.OpenClawUpdateIn; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenClawUpdateIn? 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.OpenClawUpdateIn? 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.OpenClawUpdateIn), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenClawUpdateIn; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenClawUpdateIn.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.g.cs new file mode 100644 index 00000000..39bf0564 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenClawUpdateIn.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenClawUpdateIn + { + /// + /// Instance name + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Instance name + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public OpenClawUpdateIn( + string name) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + } + + /// + /// Initializes a new instance of the class. + /// + public OpenClawUpdateIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.Json.g.cs index 8bf7a3f4..9bb2e054 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterDatacenter; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterDatacenter? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterDatacenter; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index cc1f3555..68e00978 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterDatacenter.g.cs @@ -42,5 +42,6 @@ public OpenRouterDatacenter( public OpenRouterDatacenter() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs index 5e0028c7..e6a1b18c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterModelData; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelData? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelData; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 33de60f8..39393d2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelData.g.cs @@ -9,12 +9,18 @@ namespace DeepInfra public sealed partial class OpenRouterModelData { /// - /// Model identifier + /// Model identifier used when calling the provider API /// [global::System.Text.Json.Serialization.JsonPropertyName("id")] [global::System.Text.Json.Serialization.JsonRequired] public required string Id { get; set; } + /// + /// HuggingFace model ID if available + /// + [global::System.Text.Json.Serialization.JsonPropertyName("hugging_face_id")] + public string? HuggingFaceId { get; set; } + /// /// Human-readable model name /// @@ -22,6 +28,14 @@ public sealed partial class OpenRouterModelData [global::System.Text.Json.Serialization.JsonRequired] public required string Name { get; set; } + /// + /// Unix timestamp of model creation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.UnixTimestampJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTimeOffset Created { get; set; } + /// /// Supported input modalities /// @@ -84,6 +98,12 @@ public sealed partial class OpenRouterModelData [global::System.Text.Json.Serialization.JsonPropertyName("description")] public string? Description { get; set; } + /// + /// ISO 8601 date YYYY-MM-DD for deprecation + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deprecation_date")] + public string? DeprecationDate { get; set; } + /// /// OpenRouter specific data /// @@ -107,11 +127,14 @@ public sealed partial class OpenRouterModelData /// Initializes a new instance of the class. /// /// - /// Model identifier + /// Model identifier used when calling the provider API /// /// /// Human-readable model name /// + /// + /// Unix timestamp of model creation + /// /// /// Supported input modalities /// @@ -139,9 +162,15 @@ public sealed partial class OpenRouterModelData /// /// Available datacenters /// + /// + /// HuggingFace model ID if available + /// /// /// Model description /// + /// + /// ISO 8601 date YYYY-MM-DD for deprecation + /// /// /// OpenRouter specific data /// @@ -151,6 +180,7 @@ public sealed partial class OpenRouterModelData public OpenRouterModelData( string id, string name, + global::System.DateTimeOffset created, global::System.Collections.Generic.IList inputModalities, global::System.Collections.Generic.IList outputModalities, string quantization, @@ -160,11 +190,15 @@ public OpenRouterModelData( global::System.Collections.Generic.IList supportedSamplingParameters, global::System.Collections.Generic.IList supportedFeatures, global::System.Collections.Generic.IList datacenters, + string? huggingFaceId, string? description, + string? deprecationDate, global::System.Collections.Generic.Dictionary? openrouter) { this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.HuggingFaceId = huggingFaceId; this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Created = created; this.InputModalities = inputModalities ?? throw new global::System.ArgumentNullException(nameof(inputModalities)); this.OutputModalities = outputModalities ?? throw new global::System.ArgumentNullException(nameof(outputModalities)); this.Quantization = quantization ?? throw new global::System.ArgumentNullException(nameof(quantization)); @@ -174,6 +208,7 @@ public OpenRouterModelData( this.SupportedSamplingParameters = supportedSamplingParameters ?? throw new global::System.ArgumentNullException(nameof(supportedSamplingParameters)); this.SupportedFeatures = supportedFeatures ?? throw new global::System.ArgumentNullException(nameof(supportedFeatures)); this.Description = description; + this.DeprecationDate = deprecationDate; this.Openrouter = openrouter; this.Datacenters = datacenters ?? throw new global::System.ArgumentNullException(nameof(datacenters)); } @@ -184,5 +219,6 @@ public OpenRouterModelData( public OpenRouterModelData() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.Json.g.cs new file mode 100644 index 00000000..58edae67 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenRouterModelDataDeprecationDate + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenRouterModelDataDeprecationDate? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenRouterModelDataDeprecationDate), + jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataDeprecationDate; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelDataDeprecationDate? 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.OpenRouterModelDataDeprecationDate? 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.OpenRouterModelDataDeprecationDate), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataDeprecationDate; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenRouterModelDataDeprecationDate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.g.cs new file mode 100644 index 00000000..2da2d458 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDeprecationDate.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ISO 8601 date YYYY-MM-DD for deprecation + /// + public sealed partial class OpenRouterModelDataDeprecationDate + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs index 9ed2b8f4..5a7e60e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelDataDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 8d34a432..effa4e9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenRouterModelDataDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.Json.g.cs index bde6fd64..14b77c30 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataOpenrouter; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelDataOpenrouter? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataOpenrouter; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index baaa3b3f..7bed2c40 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenRouterModelDataOpenrouter /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.Json.g.cs index 016144d8..5dde1398 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterModelDataOpenrouter2; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterModelDataOpenrouter2? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterModelDataOpenrouter2; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1c889483..8c2e5e3c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelDataOpenrouter2.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenRouterModelDataOpenrouter2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.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..e9a97344 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterModelsOut.g.cs @@ -42,5 +42,6 @@ public OpenRouterModelsOut( public OpenRouterModelsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.Json.g.cs index 5482fc29..a913fc23 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenRouterPricing; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenRouterPricing? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenRouterPricing; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 43b35a65..c662b5c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenRouterPricing.g.cs @@ -22,6 +22,13 @@ public sealed partial class OpenRouterPricing [global::System.Text.Json.Serialization.JsonRequired] public required string Completion { get; set; } + /// + /// Pricing per 1 token for cache reads
+ /// Default Value: 0 + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("input_cache_read")] + public string? InputCacheRead { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -37,15 +44,21 @@ public sealed partial class OpenRouterPricing /// /// Pricing per 1 token for output /// + /// + /// Pricing per 1 token for cache reads
+ /// Default Value: 0 + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public OpenRouterPricing( string prompt, - string completion) + string completion, + string? inputCacheRead) { this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Completion = completion ?? throw new global::System.ArgumentNullException(nameof(completion)); + this.InputCacheRead = inputCacheRead; } /// @@ -54,5 +67,6 @@ public OpenRouterPricing( public OpenRouterPricing() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.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..6193ac62 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXApiKey.Json.g.cs new file mode 100644 index 00000000..a5a1bf56 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiAudioSpeechV1AudioSpeechPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXApiKey? 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.OpenaiAudioSpeechV1AudioSpeechPostXApiKey? 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.OpenaiAudioSpeechV1AudioSpeechPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiAudioSpeechV1AudioSpeechPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXApiKey.g.cs new file mode 100644 index 00000000..b30f1228 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index cf6c71aa..2379a519 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 5fdfd59c..34a2b4ea 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXDeepinfraSource /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs index 07780b57..5b45473d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a89fa4c3..de1fff79 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1AudioSpeechPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioSpeechV1AudioSpeechPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.Json.g.cs deleted file mode 100644 index 6a73f8af..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.g.cs deleted file mode 100644 index 4600fb32..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 372d5989..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.g.cs deleted file mode 100644 index 531b3e66..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXDeepinfraSource - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.Json.g.cs deleted file mode 100644 index 49cc3753..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.g.cs deleted file mode 100644 index 31be6bc1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioSpeechV1OpenaiAudioSpeechPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.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..f20cc117 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostRe /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..d15b2d3d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey? 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey? 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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey.g.cs new file mode 100644 index 00000000..13ddafc5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 7d06180b..b72a5711 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a000f22b..be0806b0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXD /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs index e5d59adb..d23b45e4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 91d10003..158d9fe9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranscriptionsV1AudioTranscriptionsPostXi /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.Json.g.cs deleted file mode 100644 index 16d91347..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.g.cs deleted file mode 100644 index 66780aec..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 75448104..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.g.cs deleted file mode 100644 index 0253d209..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXDeepinfraSource - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.Json.g.cs deleted file mode 100644 index 04b9ae85..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.g.cs deleted file mode 100644 index ae9b7159..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranscriptionsV1OpenaiAudioTranscriptionsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.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..d3a1727b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..92bed3eb --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey? 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.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey? 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.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey.g.cs new file mode 100644 index 00000000..b7903343 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 8d5f52ce..72f55f2b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d716f614..7ce3d6ba 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXDeepi /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs index c2c7e28c..5485648f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index df1b1d13..e3975875 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1AudioTranslationsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiAudioTranslationsV1AudioTranslationsPostXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.Json.g.cs deleted file mode 100644 index cb3f1b30..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.g.cs deleted file mode 100644 index 748a2185..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 693ddd37..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.g.cs deleted file mode 100644 index 46b559a7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXDeepinfraSource - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.Json.g.cs deleted file mode 100644 index f6019ea8..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.g.cs deleted file mode 100644 index 209d0baa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiAudioTranslationsV1OpenaiAudioTranslationsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.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..9f6947e5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..3fb3be8b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey? 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.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey? 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.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey.g.cs new file mode 100644 index 00000000..5b680546 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index f4ccf123..562627a6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a49ed09e..9f298a25 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXDeepinfra /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs index a34481ab..f2f7e978 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7b82d7e0..8b02fd39 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiChatCompletionsV1ChatCompletionsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.Json.g.cs deleted file mode 100644 index ff5df855..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.g.cs deleted file mode 100644 index b39159ff..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index d18c150b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.g.cs deleted file mode 100644 index 974d2cb0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXDeepinfraSource - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.Json.g.cs deleted file mode 100644 index bff6392b..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.g.cs deleted file mode 100644 index 1bbb7489..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiChatCompletionsV1OpenaiChatCompletionsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.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..20e51082 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiCompletionsV1CompletionsPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..98beddea --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiCompletionsV1CompletionsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiCompletionsV1CompletionsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiCompletionsV1CompletionsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiCompletionsV1CompletionsPostXApiKey? 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.OpenaiCompletionsV1CompletionsPostXApiKey? 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.OpenaiCompletionsV1CompletionsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiCompletionsV1CompletionsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXApiKey.g.cs new file mode 100644 index 00000000..e0967e8b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiCompletionsV1CompletionsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 920346c9..ecbe3420 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiCompletionsV1CompletionsPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c043e8c5..079f195d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiCompletionsV1CompletionsPostXDeepinfraSource /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs index d49d2b92..887e8300 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiCompletionsV1CompletionsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1CompletionsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4110e179..43e990e8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1CompletionsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiCompletionsV1CompletionsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.Json.g.cs deleted file mode 100644 index b6f1f111..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.g.cs deleted file mode 100644 index fc9cbd62..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index e8d644a0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.g.cs deleted file mode 100644 index bf074bfc..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXDeepinfraSource - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.Json.g.cs deleted file mode 100644 index df1d4d1d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.g.cs deleted file mode 100644 index b7d04f0d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiCompletionsV1OpenaiCompletionsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.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..99276a02 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.Json.g.cs index 3b23437c..5f9a119e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostUserAgent; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostUserAgent? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostUserAgent; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0ce2adde..91824011 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostUserAgent.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostUserAgent /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..a9caf4d3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiEmbeddingsV1EmbeddingsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXApiKey? 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.OpenaiEmbeddingsV1EmbeddingsPostXApiKey? 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.OpenaiEmbeddingsV1EmbeddingsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiEmbeddingsV1EmbeddingsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXApiKey.g.cs new file mode 100644 index 00000000..4dfcffce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index d66c79d6..fe1c9dcf 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0029c5c9..ffe6d42a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXDeepinfraSource /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs index f9a610c6..e88c76ca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b4afd60f..ede76400 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1EmbeddingsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiEmbeddingsV1EmbeddingsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.Json.g.cs deleted file mode 100644 index 4e2eb91d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.g.cs deleted file mode 100644 index 647926f6..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.Json.g.cs deleted file mode 100644 index 1c70bc02..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.g.cs deleted file mode 100644 index cb437706..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostUserAgent - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.Json.g.cs deleted file mode 100644 index 1f77cb83..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.g.cs deleted file mode 100644 index 36875494..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXDeepinfraSource - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.Json.g.cs deleted file mode 100644 index 1f6884c3..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.g.cs deleted file mode 100644 index f9eb1ee1..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiEmbeddingsV1OpenaiEmbeddingsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.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..1a16609b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiFilesV1FilesPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXApiKey.Json.g.cs new file mode 100644 index 00000000..07d83146 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiFilesV1FilesPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiFilesV1FilesPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiFilesV1FilesPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1FilesPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiFilesV1FilesPostXApiKey? 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.OpenaiFilesV1FilesPostXApiKey? 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.OpenaiFilesV1FilesPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1FilesPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiFilesV1FilesPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXApiKey.g.cs new file mode 100644 index 00000000..f4436f00 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiFilesV1FilesPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 07e45697..ecc8e373 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1FilesPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiFilesV1FilesPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1FilesPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 6e20b0ab..21f93a4b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1FilesPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiFilesV1FilesPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.Json.g.cs deleted file mode 100644 index 90b56999..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiFilesV1OpenaiFilesPostResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse), - jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.g.cs deleted file mode 100644 index a44cf084..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiFilesV1OpenaiFilesPostResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.Json.g.cs deleted file mode 100644 index 40e3032d..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiFilesV1OpenaiFilesPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiFilesV1OpenaiFilesPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.g.cs deleted file mode 100644 index c43afaed..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiFilesV1OpenaiFilesPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiFilesV1OpenaiFilesPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..25bdf08f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiImagesEditsV1ImagesEditsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiImagesEditsV1ImagesEditsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXApiKey? 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.OpenaiImagesEditsV1ImagesEditsPostXApiKey? 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.OpenaiImagesEditsV1ImagesEditsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiImagesEditsV1ImagesEditsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXApiKey.g.cs new file mode 100644 index 00000000..5aded009 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiImagesEditsV1ImagesEditsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 881b6e92..8babfce6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesEditsV1ImagesEditsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 0c9392b5..26e9d6a2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1ImagesEditsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiImagesEditsV1ImagesEditsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.Json.g.cs deleted file mode 100644 index 0458ad58..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.g.cs deleted file mode 100644 index d46c3ac5..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesEditsV1OpenaiImagesEditsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..cc9be00a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey? 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.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey? 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.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey.g.cs new file mode 100644 index 00000000..02a8eb66 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiImagesGenerationsV1ImagesGenerationsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 50c80f3a..4d118d2c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3c84784c..d3210e38 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiImagesGenerationsV1ImagesGenerationsPostXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.Json.g.cs deleted file mode 100644 index 9f004397..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.g.cs deleted file mode 100644 index ddf3b8e0..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesGenerationsV1OpenaiImagesGenerationsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..cdcf9d0a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiImagesVariationsV1ImagesVariationsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey? 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.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey? 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.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey.g.cs new file mode 100644 index 00000000..0c5f86f7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiImagesVariationsV1ImagesVariationsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index b3c3209d..9ed06f58 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4c247057..60ebd43d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiImagesVariationsV1ImagesVariationsPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.Json.g.cs deleted file mode 100644 index 11765413..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.g.cs deleted file mode 100644 index 0371af14..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiImagesVariationsV1OpenaiImagesVariationsPostXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.Json.g.cs new file mode 100644 index 00000000..d4c3df36 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiModelsV1ModelsGetFilter + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenaiModelsV1ModelsGetFilter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiModelsV1ModelsGetFilter), + jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetFilter; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiModelsV1ModelsGetFilter? 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.OpenaiModelsV1ModelsGetFilter? 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.OpenaiModelsV1ModelsGetFilter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetFilter; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiModelsV1ModelsGetFilter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.g.cs new file mode 100644 index 00000000..50fdc979 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetFilter.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiModelsV1ModelsGetFilter + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.Json.g.cs new file mode 100644 index 00000000..9cf4072d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiModelsV1ModelsGetSortBy + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenaiModelsV1ModelsGetSortBy? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiModelsV1ModelsGetSortBy), + jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetSortBy; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiModelsV1ModelsGetSortBy? 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.OpenaiModelsV1ModelsGetSortBy? 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.OpenaiModelsV1ModelsGetSortBy), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetSortBy; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiModelsV1ModelsGetSortBy.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.g.cs new file mode 100644 index 00000000..0e091192 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetSortBy.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiModelsV1ModelsGetSortBy + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..25339f67 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenaiModelsV1ModelsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenaiModelsV1ModelsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenaiModelsV1ModelsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiModelsV1ModelsGetXApiKey? 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.OpenaiModelsV1ModelsGetXApiKey? 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.OpenaiModelsV1ModelsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenaiModelsV1ModelsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXApiKey.g.cs new file mode 100644 index 00000000..13092e30 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenaiModelsV1ModelsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 1475db58..4cafd4c0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1ModelsGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenaiModelsV1ModelsGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1ModelsGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 81c870c6..956d1129 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1ModelsGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class OpenaiModelsV1ModelsGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.Json.g.cs deleted file mode 100644 index 6b76cf3c..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class OpenaiModelsV1OpenaiModelsGetXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenaiModelsV1OpenaiModelsGetXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.g.cs deleted file mode 100644 index 1e681657..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenaiModelsV1OpenaiModelsGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class OpenaiModelsV1OpenaiModelsGetXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXApiKey.Json.g.cs new file mode 100644 index 00000000..22a4832d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawCatalogV1AgentsCatalogGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawCatalogV1AgentsCatalogGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXApiKey? 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.OpenclawCatalogV1AgentsCatalogGetXApiKey? 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.OpenclawCatalogV1AgentsCatalogGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawCatalogV1AgentsCatalogGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXApiKey.g.cs new file mode 100644 index 00000000..fc743265 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawCatalogV1AgentsCatalogGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..4d00167a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawCatalogV1AgentsCatalogGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawCatalogV1AgentsCatalogGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey? 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.OpenclawCatalogV1AgentsCatalogGetXiApiKey? 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.OpenclawCatalogV1AgentsCatalogGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawCatalogV1AgentsCatalogGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawCatalogV1AgentsCatalogGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.g.cs new file mode 100644 index 00000000..79dacb59 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCatalogV1AgentsCatalogGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawCatalogV1AgentsCatalogGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXApiKey.Json.g.cs new file mode 100644 index 00000000..a720e19a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawCreateV1AgentsPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawCreateV1AgentsPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawCreateV1AgentsPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawCreateV1AgentsPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawCreateV1AgentsPostXApiKey? 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.OpenclawCreateV1AgentsPostXApiKey? 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.OpenclawCreateV1AgentsPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawCreateV1AgentsPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawCreateV1AgentsPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXApiKey.g.cs new file mode 100644 index 00000000..56e06c03 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawCreateV1AgentsPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..08239390 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawCreateV1AgentsPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawCreateV1AgentsPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey? 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.OpenclawCreateV1AgentsPostXiApiKey? 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.OpenclawCreateV1AgentsPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawCreateV1AgentsPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawCreateV1AgentsPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.g.cs new file mode 100644 index 00000000..17b9faf6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawCreateV1AgentsPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawCreateV1AgentsPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.Json.g.cs new file mode 100644 index 00000000..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..508e6b8a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey.Json.g.cs new file mode 100644 index 00000000..20c727e4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey? 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.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey? 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.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey.g.cs new file mode 100644 index 00000000..8d0d398d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.Json.g.cs new file mode 100644 index 00000000..166ec068 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey? 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.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey? 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.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.g.cs new file mode 100644 index 00000000..3de56b9d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawDeleteV1AgentsInstanceIdDeleteXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..fd37e1c0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawGetV1AgentsInstanceIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawGetV1AgentsInstanceIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXApiKey? 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.OpenclawGetV1AgentsInstanceIdGetXApiKey? 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.OpenclawGetV1AgentsInstanceIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawGetV1AgentsInstanceIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXApiKey.g.cs new file mode 100644 index 00000000..ec0277d5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawGetV1AgentsInstanceIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..ca299563 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawGetV1AgentsInstanceIdGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawGetV1AgentsInstanceIdGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey? 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.OpenclawGetV1AgentsInstanceIdGetXiApiKey? 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.OpenclawGetV1AgentsInstanceIdGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawGetV1AgentsInstanceIdGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawGetV1AgentsInstanceIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.g.cs new file mode 100644 index 00000000..5bc11dcc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawGetV1AgentsInstanceIdGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawGetV1AgentsInstanceIdGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey.Json.g.cs new file mode 100644 index 00000000..41500650 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey? 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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey? 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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey.g.cs new file mode 100644 index 00000000..5048537f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..4c503d0d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey? 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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey? 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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.g.cs new file mode 100644 index 00000000..3d5a2451 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawLaunchTokenV1AgentsInstanceIdLaunchTokenPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..9dbd0b3e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey? 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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey? 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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey.g.cs new file mode 100644 index 00000000..06d10fc1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawListBackupsV1AgentsInstanceIdBackupsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..4940342c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey? 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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey? 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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.g.cs new file mode 100644 index 00000000..7ebfdad8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawListBackupsV1AgentsInstanceIdBackupsGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetState.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetState.g.cs new file mode 100644 index 00000000..016b5906 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetState.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Which instances to return: active, inactive, or all (both)
+ /// Default Value: active + ///
+ public enum OpenclawListV1AgentsGetState + { + /// + /// active, inactive, or all (both) + /// + Active, + /// + /// active, inactive, or all (both) + /// + All, + /// + /// active, inactive, or all (both) + /// + Inactive, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class OpenclawListV1AgentsGetStateExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this OpenclawListV1AgentsGetState value) + { + return value switch + { + OpenclawListV1AgentsGetState.Active => "active", + OpenclawListV1AgentsGetState.All => "all", + OpenclawListV1AgentsGetState.Inactive => "inactive", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static OpenclawListV1AgentsGetState? ToEnum(string value) + { + return value switch + { + "active" => OpenclawListV1AgentsGetState.Active, + "all" => OpenclawListV1AgentsGetState.All, + "inactive" => OpenclawListV1AgentsGetState.Inactive, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXApiKey.Json.g.cs new file mode 100644 index 00000000..5213dbb2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawListV1AgentsGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawListV1AgentsGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawListV1AgentsGetXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawListV1AgentsGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawListV1AgentsGetXApiKey? 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.OpenclawListV1AgentsGetXApiKey? 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.OpenclawListV1AgentsGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawListV1AgentsGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawListV1AgentsGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXApiKey.g.cs new file mode 100644 index 00000000..8e5f7827 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawListV1AgentsGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.Json.g.cs new file mode 100644 index 00000000..89b7b682 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawListV1AgentsGetXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawListV1AgentsGetXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawListV1AgentsGetXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawListV1AgentsGetXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawListV1AgentsGetXiApiKey? 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.OpenclawListV1AgentsGetXiApiKey? 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.OpenclawListV1AgentsGetXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawListV1AgentsGetXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawListV1AgentsGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.g.cs new file mode 100644 index 00000000..840c68de --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawListV1AgentsGetXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawListV1AgentsGetXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.Json.g.cs new file mode 100644 index 00000000..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..2f22461a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey.Json.g.cs new file mode 100644 index 00000000..8eba862c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey? 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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey? 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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey.g.cs new file mode 100644 index 00000000..8c89f9ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.Json.g.cs new file mode 100644 index 00000000..2ad1dd9a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey? 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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey? 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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.g.cs new file mode 100644 index 00000000..2506ce49 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawRestoreBackupV1AgentsInstanceIdBackupsBackupIdRestorePostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.Json.g.cs new file mode 100644 index 00000000..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..d9d95a11 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXApiKey.Json.g.cs new file mode 100644 index 00000000..25fdcaa5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawStartV1AgentsInstanceIdStartPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXApiKey? 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.OpenclawStartV1AgentsInstanceIdStartPostXApiKey? 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.OpenclawStartV1AgentsInstanceIdStartPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawStartV1AgentsInstanceIdStartPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXApiKey.g.cs new file mode 100644 index 00000000..35c96014 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..2832ccbc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey? 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.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey? 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.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.g.cs new file mode 100644 index 00000000..23a0d2de --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStartV1AgentsInstanceIdStartPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStartV1AgentsInstanceIdStartPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.Json.g.cs new file mode 100644 index 00000000..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..8df6db7a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXApiKey.Json.g.cs new file mode 100644 index 00000000..9105b07c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawStopV1AgentsInstanceIdStopPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXApiKey? 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.OpenclawStopV1AgentsInstanceIdStopPostXApiKey? 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.OpenclawStopV1AgentsInstanceIdStopPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawStopV1AgentsInstanceIdStopPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXApiKey.g.cs new file mode 100644 index 00000000..4d42f176 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..53246ecc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey? 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.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey? 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.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.g.cs new file mode 100644 index 00000000..9bbe981c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawStopV1AgentsInstanceIdStopPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawStopV1AgentsInstanceIdStopPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.Json.g.cs new file mode 100644 index 00000000..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..4c911ffd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey.Json.g.cs new file mode 100644 index 00000000..cc4adc90 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey? 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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey? 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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey.g.cs new file mode 100644 index 00000000..da1e184b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.Json.g.cs new file mode 100644 index 00000000..de15c6dc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey? 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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey? 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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.g.cs new file mode 100644 index 00000000..46f4afd1 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawTriggerBackupV1AgentsInstanceIdBackupPostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.Json.g.cs new file mode 100644 index 00000000..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..2c84e9d8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey.Json.g.cs new file mode 100644 index 00000000..3f75d376 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey? 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.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey? 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.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey.g.cs new file mode 100644 index 00000000..51784648 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.Json.g.cs new file mode 100644 index 00000000..7ffcc0bf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey? 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.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey? 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.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.g.cs new file mode 100644 index 00000000..87ace748 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateV1AgentsInstanceIdPatchXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.Json.g.cs new file mode 100644 index 00000000..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..d6460f8a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostResponse + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey.Json.g.cs new file mode 100644 index 00000000..33be33f9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey? 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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey? 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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey.g.cs new file mode 100644 index 00000000..c786a0b4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.Json.g.cs new file mode 100644 index 00000000..fba02c65 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the 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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey), + jsonSerializerContext) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey? 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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey? 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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.g.cs new file mode 100644 index 00000000..36970622 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class OpenclawUpdateVersionV1AgentsInstanceIdUpdatePostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..e123d1a1 --- /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.PaymentMethodBankBankName.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankBankName.Json.g.cs new file mode 100644 index 00000000..dd481ee3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankBankName.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodBankBankName + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PaymentMethodBankBankName? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodBankBankName), + jsonSerializerContext) as global::DeepInfra.PaymentMethodBankBankName; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBankBankName? 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.PaymentMethodBankBankName? 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.PaymentMethodBankBankName), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodBankBankName; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PaymentMethodBankBankName.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankBankName.g.cs new file mode 100644 index 00000000..826ce695 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankBankName.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodBankBankName + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankLast4.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankLast4.Json.g.cs new file mode 100644 index 00000000..4326bc35 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankLast4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodBankLast4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PaymentMethodBankLast4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodBankLast4), + jsonSerializerContext) as global::DeepInfra.PaymentMethodBankLast4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodBankLast4? 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.PaymentMethodBankLast4? 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.PaymentMethodBankLast4), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodBankLast4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PaymentMethodBankLast4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankLast4.g.cs new file mode 100644 index 00000000..c298e867 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodBankLast4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodBankLast4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..b87e1d2c --- /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.PaymentMethodCardBrand.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardBrand.Json.g.cs new file mode 100644 index 00000000..e225e21c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardBrand.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCardBrand + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PaymentMethodCardBrand? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCardBrand), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCardBrand; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCardBrand? 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.PaymentMethodCardBrand? 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.PaymentMethodCardBrand), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCardBrand; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PaymentMethodCardBrand.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardBrand.g.cs new file mode 100644 index 00000000..6289b94a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardBrand.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCardBrand + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardLast4.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardLast4.Json.g.cs new file mode 100644 index 00000000..b59127b0 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardLast4.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCardLast4 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PaymentMethodCardLast4? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCardLast4), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCardLast4; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCardLast4? 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.PaymentMethodCardLast4? 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.PaymentMethodCardLast4), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCardLast4; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PaymentMethodCardLast4.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardLast4.g.cs new file mode 100644 index 00000000..ccb97013 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardLast4.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCardLast4 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardWallet.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardWallet.Json.g.cs new file mode 100644 index 00000000..ed9465b5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardWallet.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCardWallet + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PaymentMethodCardWallet? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCardWallet), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCardWallet; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCardWallet? 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.PaymentMethodCardWallet? 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.PaymentMethodCardWallet), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCardWallet; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PaymentMethodCardWallet.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardWallet.g.cs new file mode 100644 index 00000000..ce436ffd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCardWallet.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCardWallet + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..3dbbb023 --- /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.PaymentMethodCashAppCashtag.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppCashtag.Json.g.cs new file mode 100644 index 00000000..02c3db36 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppCashtag.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PaymentMethodCashAppCashtag + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PaymentMethodCashAppCashtag? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PaymentMethodCashAppCashtag), + jsonSerializerContext) as global::DeepInfra.PaymentMethodCashAppCashtag; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PaymentMethodCashAppCashtag? 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.PaymentMethodCashAppCashtag? 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.PaymentMethodCashAppCashtag), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PaymentMethodCashAppCashtag; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PaymentMethodCashAppCashtag.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppCashtag.g.cs new file mode 100644 index 00000000..c54b89b8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PaymentMethodCashAppCashtag.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PaymentMethodCashAppCashtag + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..38568561 --- /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..b6f3ce9b --- /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..0f0f38f4 --- /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..36ad8d43 --- /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..535f90e2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOut.g.cs @@ -0,0 +1,107 @@ + +#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; } + + /// + /// Source of this config (e.g. deepinfra).
+ /// Default Value: deepinfra + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("source")] + public string? Source { get; set; } + + /// + /// Inference engine the preset was tuned for.
+ /// Default Value: vllm + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("engine")] + public string? Engine { get; set; } + + /// + /// Allowed Nx<GPU> hardware 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; } + + /// + /// Preset engine tuning knobs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("standard_args")] + public object? StandardArgs { get; set; } + + /// + /// Short display name for the preset (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> hardware configs. + /// + /// + /// Source of this config (e.g. deepinfra).
+ /// Default Value: deepinfra + /// + /// + /// Inference engine the preset was tuned for.
+ /// Default Value: vllm + /// + /// + /// Preset engine tuning knobs. + /// + /// + /// Short display name for the preset (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, + object? standardArgs, + 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.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..28e39e39 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Preset engine tuning knobs. + /// + public sealed partial class PresetConfigOutStandardArgs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs2.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs2.Json.g.cs new file mode 100644 index 00000000..a974bdb5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PresetConfigOutStandardArgs2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PresetConfigOutStandardArgs2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PresetConfigOutStandardArgs2), + jsonSerializerContext) as global::DeepInfra.PresetConfigOutStandardArgs2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PresetConfigOutStandardArgs2? 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.PresetConfigOutStandardArgs2? 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.PresetConfigOutStandardArgs2), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PresetConfigOutStandardArgs2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PresetConfigOutStandardArgs2.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs2.g.cs new file mode 100644 index 00000000..da365fc8 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PresetConfigOutStandardArgs2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PresetConfigOutStandardArgs2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.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..affb7e61 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOut.g.cs @@ -32,9 +32,9 @@ public sealed partial class PricingPageEntryOut /// /// [global::System.Text.Json.Serialization.JsonPropertyName("pricing")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::DeepInfra.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] - public required global::DeepInfra.AnyOf Pricing { get; set; } + public required global::DeepInfra.AnyOf Pricing { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -57,7 +57,7 @@ public sealed partial class PricingPageEntryOut public PricingPageEntryOut( string modelName, string shortName, - global::DeepInfra.AnyOf pricing, + global::DeepInfra.AnyOf pricing, int? maxTokens) { this.ModelName = modelName ?? throw new global::System.ArgumentNullException(nameof(modelName)); @@ -72,5 +72,6 @@ public PricingPageEntryOut( public PricingPageEntryOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.Json.g.cs index fbd3b508..07f5c187 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.PricingPageEntryOutMaxTokens; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PricingPageEntryOutMaxTokens? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PricingPageEntryOutMaxTokens; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 07193d18..cce8ed84 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageEntryOutMaxTokens.g.cs @@ -14,5 +14,6 @@ public sealed partial class PricingPageEntryOutMaxTokens /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.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..dff0c091 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingPageSectionOut.g.cs @@ -92,5 +92,6 @@ public PricingPageSectionOut( public PricingPageSectionOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs index c837402f..eae04fa0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PricingType.g.cs @@ -8,6 +8,10 @@ namespace DeepInfra /// public enum PricingType { + /// + /// + /// + FrameUnits, /// /// /// @@ -54,6 +58,7 @@ public static string ToValueString(this PricingType value) { return value switch { + PricingType.FrameUnits => "frame_units", PricingType.ImageUnits => "image_units", PricingType.InputCharacterLength => "input_character_length", PricingType.InputLength => "input_length", @@ -72,6 +77,7 @@ public static string ToValueString(this PricingType value) { return value switch { + "frame_units" => PricingType.FrameUnits, "image_units" => PricingType.ImageUnits, "input_character_length" => PricingType.InputCharacterLength, "input_length" => PricingType.InputLength, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXApiKey.Json.g.cs new file mode 100644 index 00000000..fc1f0dea --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class PrivateModelsListModelsPrivateListGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.PrivateModelsListModelsPrivateListGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.PrivateModelsListModelsPrivateListGetXApiKey), + jsonSerializerContext) as global::DeepInfra.PrivateModelsListModelsPrivateListGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PrivateModelsListModelsPrivateListGetXApiKey? 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.PrivateModelsListModelsPrivateListGetXApiKey? 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.PrivateModelsListModelsPrivateListGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PrivateModelsListModelsPrivateListGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.PrivateModelsListModelsPrivateListGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXApiKey.g.cs new file mode 100644 index 00000000..b43ce249 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class PrivateModelsListModelsPrivateListGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.Json.g.cs index fcd12bca..a45825ff 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.PrivateModelsListModelsPrivateListGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.PrivateModelsListModelsPrivateListGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.PrivateModelsListModelsPrivateListGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 28258c6b..7281a720 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.PrivateModelsListModelsPrivateListGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class PrivateModelsListModelsPrivateListGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.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..d2ec6d53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitOut.g.cs @@ -54,5 +54,6 @@ public RateLimitOut( public RateLimitOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.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..06991e16 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestIn.g.cs @@ -59,5 +59,6 @@ public RateLimitRequestIn( public RateLimitRequestIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs index 1a09be4e..eee0620a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RateLimitRequestInTpmRateLimit; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RateLimitRequestInTpmRateLimit? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RateLimitRequestInTpmRateLimit; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c268c60c..6869b590 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RateLimitRequestInTpmRateLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class RateLimitRequestInTpmRateLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.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..ba20e557 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RegexResponseFormat.g.cs @@ -53,5 +53,6 @@ public RegexResponseFormat( public RegexResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey.Json.g.cs new file mode 100644 index 00000000..56dbd226 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey), + jsonSerializerContext) as global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey? 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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey? 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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey.g.cs new file mode 100644 index 00000000..7538cb37 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RentGpuAvailabilityV1ContainersGpuAvailabilityGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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 index 334f0b76..56f11cd1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 65445f30..bce9f707 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RentGpuAvailabilityV1ContainersGpuAvailabilityGetXiA /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.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..b80c534d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostItem.g.cs @@ -50,5 +50,6 @@ public RequestCostItem( public RequestCostItem() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.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..fe0e942f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostQuery.g.cs @@ -40,5 +40,6 @@ public RequestCostQuery( public RequestCostQuery() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.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..5c938de4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestCostResponse.g.cs @@ -40,5 +40,6 @@ public RequestCostResponse( public RequestCostResponse() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs index 63f59672..960628d7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 87516280..182d1635 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostRespon /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey.Json.g.cs new file mode 100644 index 00000000..2f788a28 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey), + jsonSerializerContext) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey? 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey? 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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey.g.cs new file mode 100644 index 00000000..1a1d1f27 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 669784ee..9be8b459 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1ed09012..8dc6f1e2 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestGpuLimitIncreaseV1MeGpuLimitRequestPostXiApiK /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.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..89cebd82 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostResp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey.Json.g.cs new file mode 100644 index 00000000..aeaa14cf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey), + jsonSerializerContext) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey? 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey? 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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey.g.cs new file mode 100644 index 00000000..c807bbfc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 55d0a144..29273564 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 3d935710..7c841559 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RequestRateLimitIncreaseV1MeRateLimitRequestPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RequestRateLimitIncreaseV1MeRateLimitRequestPostXiAp /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetResponse.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.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey.Json.g.cs new file mode 100644 index 00000000..2c69782d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey), + jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey? 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey? 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.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey.g.cs new file mode 100644 index 00000000..f313f6c5 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 1c2ef2ee..21f12508 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 21a1d5b3..7f5d1254 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchV1BatchesBatchIdGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.Json.g.cs deleted file mode 100644 index 77884297..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.g.cs deleted file mode 100644 index d3afb0c2..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.Json.g.cs deleted file mode 100644 index 2a631754..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.g.cs deleted file mode 100644 index 97ebaf51..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchV1OpenaiBatchesBatchIdGetXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetAfter.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetAfter.Json.g.cs new file mode 100644 index 00000000..563b3115 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetAfter.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RetrieveOpenaiBatchesV1BatchesGetAfter + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.RetrieveOpenaiBatchesV1BatchesGetAfter? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetAfter), + jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetAfter; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetAfter? 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.RetrieveOpenaiBatchesV1BatchesGetAfter? 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.RetrieveOpenaiBatchesV1BatchesGetAfter), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetAfter; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.RetrieveOpenaiBatchesV1BatchesGetAfter.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetAfter.g.cs new file mode 100644 index 00000000..ddf2eee3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetAfter.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RetrieveOpenaiBatchesV1BatchesGetAfter + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..5e71cfc6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchesV1BatchesGetResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXApiKey.Json.g.cs new file mode 100644 index 00000000..277ccd00 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class RetrieveOpenaiBatchesV1BatchesGetXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.RetrieveOpenaiBatchesV1BatchesGetXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXApiKey), + jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXApiKey? 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.RetrieveOpenaiBatchesV1BatchesGetXApiKey? 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.RetrieveOpenaiBatchesV1BatchesGetXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.RetrieveOpenaiBatchesV1BatchesGetXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXApiKey.g.cs new file mode 100644 index 00000000..341f8213 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class RetrieveOpenaiBatchesV1BatchesGetXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 2ef2efb3..929056c7 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1BatchesGetXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index bcb3d796..afe2ac4d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1BatchesGetXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class RetrieveOpenaiBatchesV1BatchesGetXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.Json.g.cs deleted file mode 100644 index 8d6fb1c7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.g.cs deleted file mode 100644 index 756c4fa7..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetResponse - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.Json.g.cs deleted file mode 100644 index 99000508..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.Json.g.cs +++ /dev/null @@ -1,92 +0,0 @@ -#nullable enable - -namespace DeepInfra -{ - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey - { - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. - /// - public string ToJson( - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - this.GetType(), - jsonSerializerContext); - } - - /// - /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public string ToJson( - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Serialize( - this, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerContext. - /// - public static global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey), - jsonSerializerContext) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey; - } - - /// - /// Deserializes a JSON string using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey? FromJson( - string json, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.Deserialize( - json, - jsonSerializerOptions); - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerContext. - /// - public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) - { - return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - typeof(global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey), - jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey; - } - - /// - /// Deserializes a JSON stream using the provided JsonSerializerOptions. - /// -#if NET8_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] - [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] -#endif - public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( - global::System.IO.Stream jsonStream, - global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) - { - return global::System.Text.Json.JsonSerializer.DeserializeAsync( - jsonStream, - jsonSerializerOptions); - } - } -} diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.g.cs deleted file mode 100644 index 0cfdc8aa..00000000 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey.g.cs +++ /dev/null @@ -1,18 +0,0 @@ - -#nullable enable - -namespace DeepInfra -{ - /// - /// - /// - public sealed partial class RetrieveOpenaiBatchesV1OpenaiBatchesGetXiApiKey - { - - /// - /// Additional properties that are not explicitly defined in the schema - /// - [global::System.Text.Json.Serialization.JsonExtensionData] - public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); - } -} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.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..81ee01ed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScaleSettings.g.cs @@ -56,5 +56,6 @@ public ScaleSettings( public ScaleSettings() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.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..bf7bbf24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOut.g.cs @@ -77,5 +77,6 @@ public SchemaOut( public SchemaOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.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..0a3c1fe0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaIn /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.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..60274459 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaIn2.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaIn2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.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..a3158577 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut1.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaOut1 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.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..40d8ca93 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaOut12.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaOut12 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.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..487f9844 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaStream /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.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..aee87b3c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaOutSchemaStream2.g.cs @@ -14,5 +14,6 @@ public sealed partial class SchemaOutSchemaStream2 /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.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..f2aa3e6e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SchemaVariant.g.cs @@ -51,5 +51,6 @@ public SchemaVariant( public SchemaVariant() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.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..605e5a76 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTIn.g.cs @@ -84,5 +84,6 @@ public ScopedJWTIn( public ScopedJWTIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs index 8aabf8c0..b29d0c90 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScopedJWTInExpiresAt; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScopedJWTInExpiresAt? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInExpiresAt; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index acf80118..181eda9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresAt.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInExpiresAt /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.Json.g.cs index 06c781e1..479a3a18 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScopedJWTInExpiresDelta; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScopedJWTInExpiresDelta? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInExpiresDelta; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 6c5861df..2d9dcb36 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInExpiresDelta.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInExpiresDelta /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.Json.g.cs index 2cbc0a1b..fe032cbe 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScopedJWTInModels; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScopedJWTInModels? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInModels; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d717dceb..7acdac46 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInModels.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInModels /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.Json.g.cs index 94d10be9..33405c8b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.ScopedJWTInSpendingLimit; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.ScopedJWTInSpendingLimit? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.ScopedJWTInSpendingLimit; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index b7897cdc..0002a4c9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTInSpendingLimit.g.cs @@ -14,5 +14,6 @@ public sealed partial class ScopedJWTInSpendingLimit /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.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..72bd3321 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ScopedJWTOut.g.cs @@ -42,5 +42,6 @@ public ScopedJWTOut( public ScopedJWTOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.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..f440edd5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class SetConfigPaymentConfigPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.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..abdfcc50 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class SetupTopupPaymentTopupPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.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..fcf4da7b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class SetupTopupPaymentTopupPostSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.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..8648baa9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModel.g.cs @@ -49,5 +49,6 @@ public SourceModel( public SourceModel() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs index e32dc64b..a9f182d1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SourceModelCivitUrl; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SourceModelCivitUrl? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SourceModelCivitUrl; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 374e53a6..a8ac44d4 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SourceModelCivitUrl.g.cs @@ -14,5 +14,6 @@ public sealed partial class SourceModelCivitUrl /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.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..f3d90352 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyIn.g.cs @@ -54,5 +54,6 @@ public SshKeyIn( public SshKeyIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.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..7c4c50fc 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SshKeyOut.g.cs @@ -75,5 +75,6 @@ public SshKeyOut( public SshKeyOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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.StandardArgsEnablePrefixCaching.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsEnablePrefixCaching.Json.g.cs new file mode 100644 index 00000000..95fa6431 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsEnablePrefixCaching.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsEnablePrefixCaching + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsEnablePrefixCaching? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsEnablePrefixCaching), + jsonSerializerContext) as global::DeepInfra.StandardArgsEnablePrefixCaching; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsEnablePrefixCaching? 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.StandardArgsEnablePrefixCaching? 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.StandardArgsEnablePrefixCaching), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsEnablePrefixCaching; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.StandardArgsEnablePrefixCaching.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsEnablePrefixCaching.g.cs new file mode 100644 index 00000000..81c0fc3b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsEnablePrefixCaching.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Reuse KV cache for shared prompt prefixes. + /// + public sealed partial class StandardArgsEnablePrefixCaching + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsGpuMemoryFraction.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsGpuMemoryFraction.Json.g.cs new file mode 100644 index 00000000..64f91444 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsGpuMemoryFraction.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsGpuMemoryFraction + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsGpuMemoryFraction? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsGpuMemoryFraction), + jsonSerializerContext) as global::DeepInfra.StandardArgsGpuMemoryFraction; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsGpuMemoryFraction? 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.StandardArgsGpuMemoryFraction? 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.StandardArgsGpuMemoryFraction), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsGpuMemoryFraction; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.StandardArgsGpuMemoryFraction.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsGpuMemoryFraction.g.cs new file mode 100644 index 00000000..0fa7675e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsGpuMemoryFraction.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Fraction of GPU memory the engine may use for weights + KV cache. + /// + public sealed partial class StandardArgsGpuMemoryFraction + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype.Json.g.cs new file mode 100644 index 00000000..08ca2f57 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsKvCacheDtype.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsKvCacheDtype + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsKvCacheDtype? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsKvCacheDtype), + jsonSerializerContext) as global::DeepInfra.StandardArgsKvCacheDtype; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsKvCacheDtype? 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.StandardArgsKvCacheDtype? 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.StandardArgsKvCacheDtype), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsKvCacheDtype; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.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..d7360aa4 --- /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.StandardArgsMaxConcurrentRequests.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxConcurrentRequests.Json.g.cs new file mode 100644 index 00000000..a4ff2fdd --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxConcurrentRequests.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsMaxConcurrentRequests + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsMaxConcurrentRequests? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsMaxConcurrentRequests), + jsonSerializerContext) as global::DeepInfra.StandardArgsMaxConcurrentRequests; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsMaxConcurrentRequests? 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.StandardArgsMaxConcurrentRequests? 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.StandardArgsMaxConcurrentRequests), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsMaxConcurrentRequests; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.StandardArgsMaxConcurrentRequests.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxConcurrentRequests.g.cs new file mode 100644 index 00000000..07ecc9f4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxConcurrentRequests.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Max number of requests served concurrently. + /// + public sealed partial class StandardArgsMaxConcurrentRequests + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxContextSize.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxContextSize.Json.g.cs new file mode 100644 index 00000000..3ae51853 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxContextSize.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsMaxContextSize + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsMaxContextSize? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsMaxContextSize), + jsonSerializerContext) as global::DeepInfra.StandardArgsMaxContextSize; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsMaxContextSize? 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.StandardArgsMaxContextSize? 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.StandardArgsMaxContextSize), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsMaxContextSize; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.StandardArgsMaxContextSize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxContextSize.g.cs new file mode 100644 index 00000000..6fc4494a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxContextSize.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Maximum total sequence length (prompt + generation). + /// + public sealed partial class StandardArgsMaxContextSize + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxPrefillTokens.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxPrefillTokens.Json.g.cs new file mode 100644 index 00000000..fdd5284b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxPrefillTokens.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsMaxPrefillTokens + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsMaxPrefillTokens? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsMaxPrefillTokens), + jsonSerializerContext) as global::DeepInfra.StandardArgsMaxPrefillTokens; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsMaxPrefillTokens? 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.StandardArgsMaxPrefillTokens? 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.StandardArgsMaxPrefillTokens), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsMaxPrefillTokens; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.StandardArgsMaxPrefillTokens.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxPrefillTokens.g.cs new file mode 100644 index 00000000..932ae829 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsMaxPrefillTokens.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Max tokens processed per prefill/engine step (chunked prefill size). + /// + public sealed partial class StandardArgsMaxPrefillTokens + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization.Json.g.cs new file mode 100644 index 00000000..ad6c93c2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StandardArgsQuantization.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class StandardArgsQuantization + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.StandardArgsQuantization? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.StandardArgsQuantization), + jsonSerializerContext) as global::DeepInfra.StandardArgsQuantization; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.StandardArgsQuantization? 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.StandardArgsQuantization? 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.StandardArgsQuantization), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.StandardArgsQuantization; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.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..ba3c6ce0 --- /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..f38ebf23 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.StreamOptions.g.cs @@ -56,5 +56,6 @@ public StreamOptions( public StreamOptions() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.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..18507a3e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class SubmitFeedbackV1FeedbackPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXApiKey.Json.g.cs new file mode 100644 index 00000000..e4198798 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class SubmitFeedbackV1FeedbackPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.SubmitFeedbackV1FeedbackPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.SubmitFeedbackV1FeedbackPostXApiKey), + jsonSerializerContext) as global::DeepInfra.SubmitFeedbackV1FeedbackPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SubmitFeedbackV1FeedbackPostXApiKey? 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.SubmitFeedbackV1FeedbackPostXApiKey? 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.SubmitFeedbackV1FeedbackPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SubmitFeedbackV1FeedbackPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.SubmitFeedbackV1FeedbackPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXApiKey.g.cs new file mode 100644 index 00000000..d81bbf85 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class SubmitFeedbackV1FeedbackPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 1cb75703..dd156af9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.SubmitFeedbackV1FeedbackPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.SubmitFeedbackV1FeedbackPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.SubmitFeedbackV1FeedbackPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index fdb92fa3..8d447ea9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SubmitFeedbackV1FeedbackPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class SubmitFeedbackV1FeedbackPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs index b70570ec..dd620fcd 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs @@ -27,6 +27,10 @@ public enum SuspendReason /// /// /// + MissingAddress, + /// + /// + /// OverdueInvoices, /// /// @@ -50,6 +54,7 @@ public static string ToValueString(this SuspendReason value) SuspendReason.BadCc => "bad-cc", SuspendReason.Balance => "balance", SuspendReason.LimitReached => "limit-reached", + SuspendReason.MissingAddress => "missing-address", SuspendReason.OverdueInvoices => "overdue-invoices", SuspendReason.PaymentMethod => "payment-method", _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), @@ -66,6 +71,7 @@ public static string ToValueString(this SuspendReason value) "bad-cc" => SuspendReason.BadCc, "balance" => SuspendReason.Balance, "limit-reached" => SuspendReason.LimitReached, + "missing-address" => SuspendReason.MissingAddress, "overdue-invoices" => SuspendReason.OverdueInvoices, "payment-method" => SuspendReason.PaymentMethod, _ => null, diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.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..9b50b990 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey.Json.g.cs new file mode 100644 index 00000000..63da5102 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey), + jsonSerializerContext) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey? 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.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey? 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.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey.g.cs new file mode 100644 index 00000000..98dfc64f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 588f3699..23512b06 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 66a559fe..b2c88b9a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class TeamSetDisplayNameV1MeTeamDisplayNamePostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.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..80fea699 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextResponseFormat.g.cs @@ -41,5 +41,6 @@ public TextResponseFormat( public TextResponseFormat() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs index 3f45b512..8d954e04 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index d8e4ef09..de286c8a 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOutputFormat.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostOut /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.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..c956bc77 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostRes /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey.Json.g.cs new file mode 100644 index 00000000..523392e7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey), + jsonSerializerContext) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey? 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey? 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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey.g.cs new file mode 100644 index 00000000..10bfedec --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 51ece8c2..c8b3f7f6 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f8b8564f..af4ff721 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechStreamV1TextToSpeechVoiceIdStreamPostXiA /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs index 4a9549cf..131f00e9 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f8d1a844..c050b4ee 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostOutputFormat /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.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..604a11f8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey.Json.g.cs new file mode 100644 index 00000000..f8279d37 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey), + jsonSerializerContext) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey? 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.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey? 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.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey.g.cs new file mode 100644 index 00000000..0a3f7e68 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 83acbe9b..6e1ea9b0 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 845840f6..f1937b8f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class TextToSpeechV1TextToSpeechVoiceIdPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.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..de80af23 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeDeploymentStatsOut.g.cs @@ -102,5 +102,6 @@ public TimeDeploymentStatsOut( public TimeDeploymentStatsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.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..ade2bc1a --- /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.TokenizeInMessages.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessages.Json.g.cs new file mode 100644 index 00000000..725948c2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessages.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeInMessages + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TokenizeInMessages? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeInMessages), + jsonSerializerContext) as global::DeepInfra.TokenizeInMessages; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeInMessages? 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.TokenizeInMessages? 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.TokenizeInMessages), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeInMessages; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TokenizeInMessages.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessages.g.cs new file mode 100644 index 00000000..b0d62f69 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInMessages.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// chat messages to tokenize (chat form) + /// + public sealed partial class TokenizeInMessages + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..16dc7089 --- /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.TokenizeInPrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInPrompt.Json.g.cs new file mode 100644 index 00000000..6ef13a0f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInPrompt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeInPrompt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TokenizeInPrompt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeInPrompt), + jsonSerializerContext) as global::DeepInfra.TokenizeInPrompt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeInPrompt? 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.TokenizeInPrompt? 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.TokenizeInPrompt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeInPrompt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TokenizeInPrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInPrompt.g.cs new file mode 100644 index 00000000..db966bbc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInPrompt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// text to tokenize (completion form) + /// + public sealed partial class TokenizeInPrompt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInReturnTokenStrs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInReturnTokenStrs.Json.g.cs new file mode 100644 index 00000000..142dce10 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInReturnTokenStrs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeInReturnTokenStrs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TokenizeInReturnTokenStrs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeInReturnTokenStrs), + jsonSerializerContext) as global::DeepInfra.TokenizeInReturnTokenStrs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeInReturnTokenStrs? 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.TokenizeInReturnTokenStrs? 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.TokenizeInReturnTokenStrs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeInReturnTokenStrs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TokenizeInReturnTokenStrs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInReturnTokenStrs.g.cs new file mode 100644 index 00000000..96ac04e2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeInReturnTokenStrs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// also return the per-token strings (vLLM) + /// + public sealed partial class TokenizeInReturnTokenStrs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..4a441331 --- /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.TokenizeOutTokenStrs.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOutTokenStrs.Json.g.cs new file mode 100644 index 00000000..2fdb39c9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOutTokenStrs.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeOutTokenStrs + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TokenizeOutTokenStrs? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeOutTokenStrs), + jsonSerializerContext) as global::DeepInfra.TokenizeOutTokenStrs; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeOutTokenStrs? 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.TokenizeOutTokenStrs? 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.TokenizeOutTokenStrs), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeOutTokenStrs; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TokenizeOutTokenStrs.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOutTokenStrs.g.cs new file mode 100644 index 00000000..e2afee41 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeOutTokenStrs.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// per-token strings, if requested (vLLM) + /// + public sealed partial class TokenizeOutTokenStrs + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXApiKey.Json.g.cs new file mode 100644 index 00000000..342d67ce --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeV1TokenizePostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TokenizeV1TokenizePostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeV1TokenizePostXApiKey), + jsonSerializerContext) as global::DeepInfra.TokenizeV1TokenizePostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeV1TokenizePostXApiKey? 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.TokenizeV1TokenizePostXApiKey? 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.TokenizeV1TokenizePostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeV1TokenizePostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TokenizeV1TokenizePostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXApiKey.g.cs new file mode 100644 index 00000000..a4b99c39 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TokenizeV1TokenizePostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXiApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXiApiKey.Json.g.cs new file mode 100644 index 00000000..db1d7817 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXiApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class TokenizeV1TokenizePostXiApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.TokenizeV1TokenizePostXiApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.TokenizeV1TokenizePostXiApiKey), + jsonSerializerContext) as global::DeepInfra.TokenizeV1TokenizePostXiApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.TokenizeV1TokenizePostXiApiKey? 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.TokenizeV1TokenizePostXiApiKey? 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.TokenizeV1TokenizePostXiApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.TokenizeV1TokenizePostXiApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.TokenizeV1TokenizePostXiApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXiApiKey.g.cs new file mode 100644 index 00000000..29b5e758 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TokenizeV1TokenizePostXiApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class TokenizeV1TokenizePostXiApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..2ef644a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.cs @@ -69,5 +69,6 @@ public TopUpIn( public TopUpIn() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.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..83623270 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequest.g.cs @@ -48,5 +48,6 @@ public UpdateLoraApiRequest( public UpdateLoraApiRequest() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs index 63cdae00..2f5c9ae5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UpdateLoraApiRequestDescription; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateLoraApiRequestDescription? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraApiRequestDescription; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 4e713b05..3d5d3f57 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestDescription.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraApiRequestDescription /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.Json.g.cs index 0f96b6bc..7b8e946d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UpdateLoraApiRequestPrivate; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateLoraApiRequestPrivate? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraApiRequestPrivate; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c639c934..a78eceed 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraApiRequestPrivate.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraApiRequestPrivate /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.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..dfd7ccef 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchResponse.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraV1LoraLoraNamePatchResponse /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXApiKey.Json.g.cs new file mode 100644 index 00000000..5b4c0180 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class UpdateLoraV1LoraLoraNamePatchXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.UpdateLoraV1LoraLoraNamePatchXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXApiKey), + jsonSerializerContext) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXApiKey? 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.UpdateLoraV1LoraLoraNamePatchXApiKey? 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.UpdateLoraV1LoraLoraNamePatchXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.UpdateLoraV1LoraLoraNamePatchXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXApiKey.g.cs new file mode 100644 index 00000000..df41733a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class UpdateLoraV1LoraLoraNamePatchXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 5ae297ad..bd9ee35c 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateLoraV1LoraLoraNamePatchXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2a0a675d..bb996534 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateLoraV1LoraLoraNamePatchXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateLoraV1LoraLoraNamePatchXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey.Json.g.cs new file mode 100644 index 00000000..b5329543 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class UpdateVoiceV1VoicesVoiceIdEditPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey), + jsonSerializerContext) as global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey? 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.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey? 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.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey.g.cs new file mode 100644 index 00000000..8eb83098 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class UpdateVoiceV1VoicesVoiceIdEditPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index faa3bc3b..3b9a8e24 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index c97affb1..b66b86ae 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class UpdateVoiceV1VoicesVoiceIdEditPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXApiKey.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXApiKey.Json.g.cs new file mode 100644 index 00000000..2a8f7c55 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXApiKey.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class UploadLoraModelLoraModelPostXApiKey + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.UploadLoraModelLoraModelPostXApiKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.UploadLoraModelLoraModelPostXApiKey), + jsonSerializerContext) as global::DeepInfra.UploadLoraModelLoraModelPostXApiKey; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UploadLoraModelLoraModelPostXApiKey? 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.UploadLoraModelLoraModelPostXApiKey? 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.UploadLoraModelLoraModelPostXApiKey), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UploadLoraModelLoraModelPostXApiKey; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.UploadLoraModelLoraModelPostXApiKey.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXApiKey.g.cs new file mode 100644 index 00000000..7298cf83 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXApiKey.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class UploadLoraModelLoraModelPostXApiKey + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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 index 4045f2de..2ad7c287 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UploadLoraModelLoraModelPostXiApiKey; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UploadLoraModelLoraModelPostXiApiKey? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UploadLoraModelLoraModelPostXiApiKey; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index f0be8bca..41922284 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UploadLoraModelLoraModelPostXiApiKey.g.cs @@ -14,5 +14,6 @@ public sealed partial class UploadLoraModelLoraModelPostXiApiKey /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.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..a536e770 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageApiTokenPaymentUsageApiTokenGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs index ba99e853..3155ff49 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetTo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetTo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageApiTokenPaymentUsageApiTokenGetTo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 36dc98e4..ec0e7ffa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageApiTokenPaymentUsageApiTokenGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.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..ddd05847 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.cs @@ -111,5 +111,6 @@ public UsageItem( public UsageItem() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.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..a46652af 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.cs @@ -89,5 +89,6 @@ public UsageMonth( public UsageMonth() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.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..59c9be5b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.cs @@ -52,5 +52,6 @@ public UsageOut( public UsageOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.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..b371659b 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsagePaymentUsageGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs index bfb6d715..346e8611 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsagePaymentUsageGetTo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsagePaymentUsageGetTo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsagePaymentUsageGetTo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 7ef9f675..9b6350a1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsagePaymentUsageGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.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..a516e8fa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.cs @@ -42,5 +42,6 @@ public UsageRentOut( public UsageRentOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.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..dda858aa 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageRentPaymentUsageRentGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs index 949c5971..715643b8 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageRentPaymentUsageRentGetTo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageRentPaymentUsageRentGetTo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageRentPaymentUsageRentGetTo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 32b3f35b..1ad2bfc5 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageRentPaymentUsageRentGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.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..dbba4f53 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageTokensPaymentUsageTokensGetSession /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs index fb5a3e73..61116b71 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.UsageTokensPaymentUsageTokensGetTo; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.UsageTokensPaymentUsageTokensGetTo? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.UsageTokensPaymentUsageTokensGetTo; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 47ef0820..d4696d9f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.cs @@ -14,5 +14,6 @@ public sealed partial class UsageTokensPaymentUsageTokensGetTo /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.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..835105ad 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.ValidationError.g.cs @@ -60,5 +60,6 @@ public ValidationError( public ValidationError() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.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..e9d97550 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationIn.g.cs @@ -0,0 +1,109 @@ + +#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; } + + /// + /// Additional properties that are not explicitly defined 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 VideoGenerationIn( + string model, + string prompt, + string? negativePrompt, + string? aspectRatio, + string? size, + int? seconds, + int? seed, + string? style) + { + 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; + } + + /// + /// Initializes a new instance of the class. + /// + public VideoGenerationIn() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInAspectRatio.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInAspectRatio.Json.g.cs new file mode 100644 index 00000000..667568c9 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInAspectRatio.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationInAspectRatio + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationInAspectRatio? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationInAspectRatio), + jsonSerializerContext) as global::DeepInfra.VideoGenerationInAspectRatio; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationInAspectRatio? 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.VideoGenerationInAspectRatio? 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.VideoGenerationInAspectRatio), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationInAspectRatio; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationInAspectRatio.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInAspectRatio.g.cs new file mode 100644 index 00000000..7c4ebb2e --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInAspectRatio.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationInAspectRatio + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInNegativePrompt.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInNegativePrompt.Json.g.cs new file mode 100644 index 00000000..acaafaaf --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInNegativePrompt.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationInNegativePrompt + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationInNegativePrompt? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationInNegativePrompt), + jsonSerializerContext) as global::DeepInfra.VideoGenerationInNegativePrompt; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationInNegativePrompt? 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.VideoGenerationInNegativePrompt? 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.VideoGenerationInNegativePrompt), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationInNegativePrompt; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationInNegativePrompt.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInNegativePrompt.g.cs new file mode 100644 index 00000000..4063c90c --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInNegativePrompt.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationInNegativePrompt + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeconds.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeconds.Json.g.cs new file mode 100644 index 00000000..61c739f4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeconds.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationInSeconds + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationInSeconds? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationInSeconds), + jsonSerializerContext) as global::DeepInfra.VideoGenerationInSeconds; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationInSeconds? 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.VideoGenerationInSeconds? 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.VideoGenerationInSeconds), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationInSeconds; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationInSeconds.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeconds.g.cs new file mode 100644 index 00000000..1b938ef6 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeconds.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationInSeconds + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeed.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeed.Json.g.cs new file mode 100644 index 00000000..be388b0a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeed.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationInSeed + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationInSeed? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationInSeed), + jsonSerializerContext) as global::DeepInfra.VideoGenerationInSeed; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationInSeed? 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.VideoGenerationInSeed? 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.VideoGenerationInSeed), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationInSeed; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationInSeed.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeed.g.cs new file mode 100644 index 00000000..613fbf9a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSeed.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationInSeed + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSize.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSize.Json.g.cs new file mode 100644 index 00000000..0c132d2b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSize.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationInSize + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationInSize? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationInSize), + jsonSerializerContext) as global::DeepInfra.VideoGenerationInSize; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationInSize? 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.VideoGenerationInSize? 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.VideoGenerationInSize), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationInSize; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationInSize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSize.g.cs new file mode 100644 index 00000000..64d3d092 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInSize.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationInSize + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInStyle.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInStyle.Json.g.cs new file mode 100644 index 00000000..63bf3325 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInStyle.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationInStyle + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationInStyle? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationInStyle), + jsonSerializerContext) as global::DeepInfra.VideoGenerationInStyle; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationInStyle? 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.VideoGenerationInStyle? 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.VideoGenerationInStyle), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationInStyle; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationInStyle.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInStyle.g.cs new file mode 100644 index 00000000..78d75707 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationInStyle.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationInStyle + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..fb280b39 --- /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.VideoGenerationOutData.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutData.Json.g.cs new file mode 100644 index 00000000..15d28c61 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutData.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationOutData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationOutData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationOutData), + jsonSerializerContext) as global::DeepInfra.VideoGenerationOutData; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationOutData? 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.VideoGenerationOutData? 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.VideoGenerationOutData), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationOutData; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationOutData.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutData.g.cs new file mode 100644 index 00000000..e09d5493 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutData.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationOutData + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ 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..dae598ec --- /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.VideoGenerationOutError.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutError.Json.g.cs new file mode 100644 index 00000000..c9a74f7b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutError.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace DeepInfra +{ + public sealed partial class VideoGenerationOutError + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.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.VideoGenerationOutError? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::DeepInfra.VideoGenerationOutError), + jsonSerializerContext) as global::DeepInfra.VideoGenerationOutError; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.VideoGenerationOutError? 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.VideoGenerationOutError? 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.VideoGenerationOutError), + jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.VideoGenerationOutError; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.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.VideoGenerationOutError.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutError.g.cs new file mode 100644 index 00000000..dac75a85 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoGenerationOutError.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoGenerationOutError + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary 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..171f436a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.VideoURL.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// + /// + public sealed partial class VideoURL + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("url")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Url { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public VideoURL( + string url) + { + this.Url = url ?? throw new global::System.ArgumentNullException(nameof(url)); + } + + /// + /// Initializes a new instance of the class. + /// + public VideoURL() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.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..31389cab 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.Voice.g.cs @@ -87,5 +87,6 @@ public Voice( public Voice() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.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..3e4b643e 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOut.g.cs @@ -74,5 +74,6 @@ public WebLiveMetricsOut( public WebLiveMetricsOut() { } + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs index 80331fc2..c3d86b48 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutRequestsPerSecond; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.WebLiveMetricsOutRequestsPerSecond? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutRequestsPerSecond; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index a381df5b..7c450c9f 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutRequestsPerSecond.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutRequestsPerSecond /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.Json.g.cs index 6a5d95a0..c0d80f21 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutTimeToFirstToken; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.WebLiveMetricsOutTimeToFirstToken? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutTimeToFirstToken; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2f7decc3..3579a415 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTimeToFirstToken.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutTimeToFirstToken /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.Json.g.cs index 3d2724fc..c71ac814 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutTokensPerSecond; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.WebLiveMetricsOutTokensPerSecond? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutTokensPerSecond; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 2337b82e..883c3679 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTokensPerSecond.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutTokensPerSecond /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.Json.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.Json.g.cs index dace188d..46723fca 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.Json.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.Json.g.cs @@ -16,6 +16,14 @@ public string ToJson( jsonSerializerContext); } + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. /// @@ -26,6 +34,11 @@ public string ToJson( public string ToJson( global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return ToJson(global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Serialize( this, jsonSerializerOptions); @@ -44,6 +57,17 @@ public string ToJson( jsonSerializerContext) as global::DeepInfra.WebLiveMetricsOutTotalTflops; } + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::DeepInfra.WebLiveMetricsOutTotalTflops? FromJson( + string json) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON string using the provided JsonSerializerOptions. /// @@ -55,6 +79,13 @@ public string ToJson( string json, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::DeepInfra.SourceGenerationContext.Default); + } + return global::System.Text.Json.JsonSerializer.Deserialize( json, jsonSerializerOptions); @@ -73,6 +104,17 @@ public string ToJson( jsonSerializerContext).ConfigureAwait(false)) as global::DeepInfra.WebLiveMetricsOutTotalTflops; } + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + /// /// Deserializes a JSON stream using the provided JsonSerializerOptions. /// @@ -84,6 +126,13 @@ public string ToJson( global::System.IO.Stream jsonStream, global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::DeepInfra.SourceGenerationContext.Default); + } + 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 index 1fed5054..3c8d5334 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Models.WebLiveMetricsOutTotalTflops.g.cs @@ -14,5 +14,6 @@ public sealed partial class WebLiveMetricsOutTotalTflops /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + } } \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.GetHardware.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.GetHardware.g.cs new file mode 100644 index 00000000..d1693f20 --- /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..ed1099da --- /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..31834093 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamiliesNames.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelFamiliesNamesSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelFamiliesNamesSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelFamiliesNamesSecurityRequirement0, + }; + partial void PrepareModelFamiliesNamesArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelFamiliesNamesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelFamiliesNamesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelFamiliesNamesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Families Names + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModelFamiliesNamesAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelFamiliesNamesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Families Names + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ModelFamiliesNamesAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelFamiliesNamesArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelFamiliesNamesSecurityRequirements, + operationName: "ModelFamiliesNamesAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/model-families/names", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelFamiliesNamesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelFamiliesNamesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamiliesNames", + methodName: "ModelFamiliesNamesAsync", + pathTemplate: "\"/model-families/names\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelFamiliesNamesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamily.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamily.g.cs new file mode 100644 index 00000000..d08f2c60 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelFamily.g.cs @@ -0,0 +1,498 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelFamilySecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelFamilySecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelFamilySecurityRequirement0, + }; + partial void PrepareModelFamilyArguments( + global::System.Net.Http.HttpClient httpClient, + ref string familyName); + partial void PrepareModelFamilyRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string familyName); + partial void ProcessModelFamilyResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelFamilyResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Model Family + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ModelFamilyAsync( + string familyName, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelFamilyAsResponseAsync( + familyName: familyName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Model Family + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModelFamilyAsResponseAsync( + string familyName, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelFamilyArguments( + httpClient: HttpClient, + familyName: ref familyName); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelFamilySecurityRequirements, + operationName: "ModelFamilyAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: $"/model-families/{familyName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelFamilyRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + familyName: familyName!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelFamilyResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelFamily", + methodName: "ModelFamilyAsync", + pathTemplate: "$\"/model-families/{familyName}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Not Found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::DeepInfra.DeepError? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::DeepInfra.DeepError.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelFamilyResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.ModelFamilyOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.ModelFamilyOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs new file mode 100644 index 00000000..cb00a4af --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelMetaUpdate.g.cs @@ -0,0 +1,642 @@ + +#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) + /// + /// + /// 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, + global::DeepInfra.HFTasksE? reportedType = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.ModelMetaIn + { + Description = description, + GithubUrl = githubUrl, + PaperUrl = paperUrl, + LicenseUrl = licenseUrl, + Readme = readme, + CoverImgUrl = coverImgUrl, + ReportedType = reportedType, + }; + + return await ModelMetaUpdateAsync( + modelName: modelName, + xiApiKey: xiApiKey, + 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..6f494d09 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelPublicity.g.cs @@ -0,0 +1,612 @@ + +#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)); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__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..e63b9605 --- /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..2ccd7ddb --- /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..bbfa9713 --- /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..0b6ffac7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsFeatured.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsFeaturedSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsFeaturedSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsFeaturedSecurityRequirement0, + }; + partial void PrepareModelsFeaturedArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelsFeaturedRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelsFeaturedResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsFeaturedResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models Featured + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModelsFeaturedAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsFeaturedAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models Featured + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ModelsFeaturedAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsFeaturedArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsFeaturedSecurityRequirements, + operationName: "ModelsFeaturedAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/featured", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsFeaturedRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelsFeaturedResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsFeatured", + methodName: "ModelsFeaturedAsync", + pathTemplate: "\"/models/featured\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsFeaturedResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsInfo.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsInfo.g.cs new file mode 100644 index 00000000..ccb46518 --- /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..2a2dcef3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsList.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsListSecurityRequirement0, + }; + partial void PrepareModelsListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models List + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModelsListAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models List + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ModelsListAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsListArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsListSecurityRequirements, + operationName: "ModelsListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/list", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsList", + methodName: "ModelsListAsync", + pathTemplate: "\"/models/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsLoraList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsLoraList.g.cs new file mode 100644 index 00000000..d93246e4 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.ModelsLoraList.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_ModelsLoraListSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_ModelsLoraListSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_ModelsLoraListSecurityRequirement0, + }; + partial void PrepareModelsLoraListArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareModelsLoraListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessModelsLoraListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsLoraListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Models Lora List + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ModelsLoraListAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModelsLoraListAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Models Lora List + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task>> ModelsLoraListAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareModelsLoraListArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ModelsLoraListSecurityRequirements, + operationName: "ModelsLoraListAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/models/lora/list", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsLoraListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelsLoraListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ModelsLoraList", + methodName: "ModelsLoraListAsync", + pathTemplate: "\"/models/lora/list\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsLoraListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse>( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenaiModels.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenaiModels.g.cs new file mode 100644 index 00000000..cb2a7cd7 --- /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..3abaa9b7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.OpenrouterModels.g.cs @@ -0,0 +1,415 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class ModelsClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_OpenrouterModelsSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_OpenrouterModelsSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_OpenrouterModelsSecurityRequirement0, + }; + partial void PrepareOpenrouterModelsArguments( + global::System.Net.Http.HttpClient httpClient); + partial void PrepareOpenrouterModelsRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage); + partial void ProcessOpenrouterModelsResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessOpenrouterModelsResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Openrouter Models + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenrouterModelsAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OpenrouterModelsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Openrouter Models + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> OpenrouterModelsAsResponseAsync( + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareOpenrouterModelsArguments( + httpClient: HttpClient); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_OpenrouterModelsSecurityRequirements, + operationName: "OpenrouterModelsAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/openrouter/models", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareOpenrouterModelsRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessOpenrouterModelsResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "OpenrouterModels", + methodName: "OpenrouterModelsAsync", + pathTemplate: "\"/openrouter/models\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessOpenrouterModelsResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::DeepInfra.OpenRouterModelsOut.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::DeepInfra.OpenRouterModelsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.PrivateModelsList.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.PrivateModelsList.g.cs new file mode 100644 index 00000000..30973a9d --- /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..9f818b69 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.ModelsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Browse, search, and manage AI models.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ModelsClient : global::DeepInfra.IModelsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ModelsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ModelsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ModelsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the ModelsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public ModelsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.OptionsSupport.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.OptionsSupport.g.cs new file mode 100644 index 00000000..9825b45a --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.OptionsSupport.g.cs @@ -0,0 +1,937 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Global defaults applied to generated SDK requests. + /// + public sealed class AutoSDKClientOptions + { + /// + /// Additional headers applied to every request after generated headers are set. + /// Entries with the same key overwrite earlier header values. + /// + public global::System.Collections.Generic.Dictionary Headers { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.OrdinalIgnoreCase); + + /// + /// Additional query parameters appended to every request. + /// Request-level entries with the same key are appended after client defaults. + /// + public global::System.Collections.Generic.Dictionary QueryParameters { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.Ordinal); + + /// + /// Optional timeout applied to the full request execution. + /// + public global::System.TimeSpan? Timeout { get; set; } + + /// + /// Default retry behavior for generated HTTP requests. + /// + public global::DeepInfra.AutoSDKRetryOptions Retry { get; set; } = new global::DeepInfra.AutoSDKRetryOptions(); + + /// + /// Overrides the client-wide response buffering mode when set. + /// + public bool? ReadResponseAsString { get; set; } + + /// + /// Reusable hooks invoked for every generated SDK request. + /// + public global::System.Collections.Generic.List Hooks { get; } = + new global::System.Collections.Generic.List(); + + /// + /// Registers a hook for all requests issued by this client. + /// + /// + /// The current options instance. + public global::DeepInfra.AutoSDKClientOptions AddHook( + global::DeepInfra.IAutoSDKHook hook) + { + Hooks.Add(hook ?? throw new global::System.ArgumentNullException(nameof(hook))); + return this; + } + + /// + /// Optional per-request authorization provider invoked before each request is sent. + /// Set this when the client is registered as a singleton in DI but each call needs + /// a fresh credential resolved from a provider, secret-store, or session — instead + /// of mutating the shared Authorizations list at construction time. + /// + public global::DeepInfra.IAutoSDKAuthorizationProvider? AuthorizationProvider { get; set; } + + /// + /// Convenience helper that registers + /// using so request-level auth is resolved without + /// touching shared client state. + /// + /// + public global::DeepInfra.AutoSDKClientOptions UseAuthorizationProvider( + global::DeepInfra.IAutoSDKAuthorizationProvider provider) + { + AuthorizationProvider = provider ?? throw new global::System.ArgumentNullException(nameof(provider)); + if (Hooks.Find(static x => x is global::DeepInfra.AutoSDKAuthorizationProviderHook) == null) + { + Hooks.Add(new global::DeepInfra.AutoSDKAuthorizationProviderHook()); + } + + return this; + } + } + + /// + /// A request-level authorization value supplied by . + /// Mirrors the runtime fields the SDK applies for HTTP / OAuth2 / API-key auth without + /// requiring the consumer to construct the generated EndPointAuthorization type. + /// + public readonly struct AutoSDKAuthorizationValue + { + /// + /// Initializes a new . + /// + /// + /// + /// + /// + /// + public AutoSDKAuthorizationValue( + string value, + string scheme = "Bearer", + string? headerName = null, + string location = "Header", + string type = "Http") + { + Value = value ?? string.Empty; + Scheme = string.IsNullOrWhiteSpace(scheme) ? "Bearer" : scheme; + HeaderName = headerName ?? string.Empty; + Location = string.IsNullOrWhiteSpace(location) ? "Header" : location; + Type = string.IsNullOrWhiteSpace(type) ? "Http" : type; + } + + /// The credential value (token, API key, etc.). + public string Value { get; } + + /// The HTTP authorization scheme — typically Bearer, Basic, or Token. + public string Scheme { get; } + + /// The custom header name when is ApiKey; ignored for HTTP/OAuth2 auth. + public string HeaderName { get; } + + /// The credential location — Header, Query, or Cookie. + public string Location { get; } + + /// The auth type — Http, OAuth2, OpenIdConnect, or ApiKey. + public string Type { get; } + + /// Convenience factory for a Bearer token. + public static global::DeepInfra.AutoSDKAuthorizationValue Bearer(string token) => new(value: token, scheme: "Bearer"); + + /// Convenience factory for an API-key header. + public static global::DeepInfra.AutoSDKAuthorizationValue ApiKeyHeader(string name, string value) => + new(value: value, headerName: name, location: "Header", type: "ApiKey"); + } + + /// + /// Resolves request-level authorization values without mutating the shared client + /// authorization list. Implementations should be safe to invoke concurrently — + /// the hook calls them once per outgoing request. + /// + public interface IAutoSDKAuthorizationProvider + { + /// + /// Returns one or more values to apply to + /// the current request, or an empty list / null to leave the request as-is. + /// + /// + global::System.Threading.Tasks.Task?> ResolveAsync( + global::DeepInfra.AutoSDKHookContext context); + } + + /// + /// Marker keys stamped onto outgoing + /// instances so consumer s — and any + /// other transport-layer code that runs after AutoSDK's send pipeline — can observe whether + /// the resolved Authorization is call-scoped and opt out of overwriting it with a + /// rotation-aware account-level credential. + /// + public static class AutoSDKHttpRequestOptions + { + /// + /// Key under which records the marker. Exposed + /// for handlers that target frameworks older than .NET 5 and need to read the value + /// through the legacy HttpRequestMessage.Properties bag. + /// + public const string AuthorizationOverrideKey = "AutoSDK.AuthorizationOverride"; + +#if NET5_0_OR_GREATER + /// + /// Strongly-typed for + /// the call-scoped Authorization marker on .NET 5+ targets. Consumers should prefer this + /// over the legacy HttpRequestMessage.Properties bag where available. + /// + public static readonly global::System.Net.Http.HttpRequestOptionsKey AuthorizationOverride = + new global::System.Net.Http.HttpRequestOptionsKey(AuthorizationOverrideKey); +#endif + + /// + /// Stamps the call-scoped Authorization marker on . AutoSDK's + /// built-in calls this whenever the + /// resolved auth came from a per-request override or a client-level + /// . Hand-written SDK extensions that set a + /// non-default Authorization header (e.g. a session-scoped bearer returned by an + /// upstream poll) should call this too so downstream rotation handlers know to skip the + /// overwrite. + /// + /// + public static void StampAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return; + } + +#if NET5_0_OR_GREATER + request.Options.Set(AuthorizationOverride, true); +#else +#pragma warning disable CS0618 // HttpRequestMessage.Properties is obsolete in NET5+, but the only option below it. + request.Properties[AuthorizationOverrideKey] = true; +#pragma warning restore CS0618 +#endif + } + + /// + /// Returns true when previously marked the + /// request as carrying a call-scoped Authorization. + /// + /// + public static bool HasAuthorizationOverride( + global::System.Net.Http.HttpRequestMessage? request) + { + if (request is null) + { + return false; + } + +#if NET5_0_OR_GREATER + return request.Options.TryGetValue(AuthorizationOverride, out var value) && value; +#else +#pragma warning disable CS0618 + return request.Properties.TryGetValue(AuthorizationOverrideKey, out var raw) && + raw is bool flag && + flag; +#pragma warning restore CS0618 +#endif + } + } + + /// + /// Built-in that consults + /// before every outgoing + /// request and stamps the resolved values onto the . + /// + public sealed class AutoSDKAuthorizationProviderHook : global::DeepInfra.AutoSDKHook + { + /// + public override async global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKHookContext context) + { + context = context ?? throw new global::System.ArgumentNullException(nameof(context)); + + if (context.Request == null) + { + return; + } + + var perRequest = context.RequestOptions?.Authorizations; + if (perRequest != null && perRequest.Count > 0) + { + for (var index = 0; index < perRequest.Count; index++) + { + ApplyAuthorization(context.Request, perRequest[index]); + } + + global::DeepInfra.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + return; + } + + var provider = context.ClientOptions?.AuthorizationProvider; + if (provider == null) + { + return; + } + + var resolved = await provider.ResolveAsync(context).ConfigureAwait(false); + if (resolved == null || resolved.Count == 0) + { + return; + } + + for (var index = 0; index < resolved.Count; index++) + { + ApplyAuthorization(context.Request, resolved[index]); + } + + global::DeepInfra.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request); + } + + private static void ApplyAuthorization( + global::System.Net.Http.HttpRequestMessage request, + global::DeepInfra.AutoSDKAuthorizationValue authorization) + { + switch (authorization.Type) + { + case "Http": + case "OAuth2": + case "OpenIdConnect": + request.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: authorization.Scheme, + parameter: authorization.Value); + break; + case "ApiKey": + if (string.Equals(authorization.Location, "Header", global::System.StringComparison.OrdinalIgnoreCase) && + !string.IsNullOrEmpty(authorization.HeaderName)) + { + request.Headers.Remove(authorization.HeaderName); + request.Headers.TryAddWithoutValidation(authorization.HeaderName, authorization.Value ?? string.Empty); + } + break; + } + } + } + + /// + /// Per-request overrides applied on top of . + /// + public sealed class AutoSDKRequestOptions + { + /// + /// Additional headers applied after generated and client-level headers. + /// + public global::System.Collections.Generic.Dictionary Headers { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.OrdinalIgnoreCase); + + /// + /// Additional query parameters appended after generated and client-level query parameters. + /// + public global::System.Collections.Generic.Dictionary QueryParameters { get; } = + new global::System.Collections.Generic.Dictionary(global::System.StringComparer.Ordinal); + + /// + /// Optional timeout override for this request. + /// + public global::System.TimeSpan? Timeout { get; set; } + + /// + /// Optional retry override for this request. + /// + public global::DeepInfra.AutoSDKRetryOptions? Retry { get; set; } + + /// + /// Overrides response buffering for this request when set. + /// + public bool? ReadResponseAsString { get; set; } + + /// + /// Optional per-request authorization values. When non-empty, the built-in + /// applies these instead of consulting + /// for this request only. + /// Useful for multi-tenant routing or "act-as" admin tooling that needs a different + /// credential per call without mutating shared client state. + /// + public global::System.Collections.Generic.IReadOnlyList? Authorizations { get; set; } + } + + /// + /// Retry settings for generated HTTP requests. + /// + public sealed class AutoSDKRetryOptions + { + /// + /// Total number of attempts, including the initial request. + /// Values less than 1 are normalized to 1. + /// + public int MaxAttempts { get; set; } = 1; + + /// + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. + /// + public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; + } + + + /// + /// Runtime hook interface for generated SDK lifecycle events. + /// + public interface IAutoSDKHook + { + /// + /// Runs before a request is sent. + /// + /// + global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKHookContext context); + + /// + /// Runs after a successful HTTP response is received. + /// + /// + global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::DeepInfra.AutoSDKHookContext context); + + /// + /// Runs after an error response or transport failure is observed. + /// + /// + global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::DeepInfra.AutoSDKHookContext context); + } + + /// + /// Convenience base type for request hooks with no-op defaults. + /// + public abstract class AutoSDKHook : global::DeepInfra.IAutoSDKHook + { + /// + public virtual global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::DeepInfra.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + + /// + public virtual global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::DeepInfra.AutoSDKHookContext context) + { + return global::System.Threading.Tasks.Task.CompletedTask; + } + } + + /// + /// Runtime metadata passed to generated SDK hooks. + /// + public sealed class AutoSDKHookContext + { + /// + /// The source OpenAPI operation id or generated fallback id. + /// + public string OperationId { get; set; } = string.Empty; + + /// + /// The generated C# method name. + /// + public string MethodName { get; set; } = string.Empty; + + /// + /// The OpenAPI path template for the operation. + /// + public string PathTemplate { get; set; } = string.Empty; + + /// + /// The HTTP method used for the request. + /// + public string HttpMethod { get; set; } = string.Empty; + + /// + /// The client's resolved base URI. + /// + public global::System.Uri? BaseUri { get; set; } + + /// + /// The outgoing HTTP request for the current attempt. + /// + public global::System.Net.Http.HttpRequestMessage Request { get; set; } = null!; + + /// + /// The HTTP response when one was received. + /// + public global::System.Net.Http.HttpResponseMessage? Response { get; set; } + + /// + /// The transport or processing exception when one was observed. + /// + public global::System.Exception? Exception { get; set; } + + /// + /// The client-wide runtime options. + /// + public global::DeepInfra.AutoSDKClientOptions ClientOptions { get; set; } = null!; + + /// + /// The per-request runtime options. + /// + public global::DeepInfra.AutoSDKRequestOptions? RequestOptions { get; set; } + + /// + /// The current attempt number, starting at 1. + /// + public int Attempt { get; set; } + + /// + /// The total number of attempts allowed for this request. + /// + public int MaxAttempts { get; set; } + + /// + /// Indicates whether the generated client will retry after this hook invocation. + /// + public bool WillRetry { get; set; } + + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + + /// + /// The effective cancellation token for the current request attempt. + /// + public global::System.Threading.CancellationToken CancellationToken { get; set; } + } + + + internal static class AutoSDKRequestOptionsSupport + { + internal static global::DeepInfra.AutoSDKHookContext CreateHookContext( + string operationId, + string methodName, + string pathTemplate, + string httpMethod, + global::System.Uri? baseUri, + global::System.Net.Http.HttpRequestMessage request, + global::System.Net.Http.HttpResponseMessage? response, + global::System.Exception? exception, + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + int attempt, + int maxAttempts, + bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, + global::System.Threading.CancellationToken cancellationToken) + { + return new global::DeepInfra.AutoSDKHookContext + { + OperationId = operationId ?? string.Empty, + MethodName = methodName ?? string.Empty, + PathTemplate = pathTemplate ?? string.Empty, + HttpMethod = httpMethod ?? string.Empty, + BaseUri = baseUri, + Request = request, + Response = response, + Exception = exception, + ClientOptions = clientOptions, + RequestOptions = requestOptions, + Attempt = attempt, + MaxAttempts = maxAttempts, + WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, + CancellationToken = cancellationToken, + }; + } + + internal static global::System.Threading.Tasks.Task OnBeforeRequestAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnBeforeRequestAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterSuccessAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterSuccessAsync(hookContext), context); + } + + internal static global::System.Threading.Tasks.Task OnAfterErrorAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKHookContext context) + { + return InvokeHooksAsync(clientOptions, static (hook, hookContext) => hook.OnAfterErrorAsync(hookContext), context); + } + + internal static bool GetReadResponseAsString( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + bool fallbackValue) + { + return requestOptions?.ReadResponseAsString ?? + clientOptions.ReadResponseAsString ?? + fallbackValue; + } + + internal static global::System.Threading.CancellationTokenSource? CreateTimeoutCancellationTokenSource( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + global::System.Threading.CancellationToken cancellationToken) + { + var timeout = requestOptions?.Timeout ?? clientOptions.Timeout; + if (!timeout.HasValue || timeout.Value <= global::System.TimeSpan.Zero) + { + return null; + } + + var cancellationTokenSource = global::System.Threading.CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + cancellationTokenSource.CancelAfter(timeout.Value); + return cancellationTokenSource; + } + + internal static int GetMaxAttempts( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + bool supportsRetry) + { + if (!supportsRetry) + { + return 1; + } + + var maxAttempts = requestOptions?.Retry?.MaxAttempts ?? + clientOptions.Retry?.MaxAttempts ?? + 1; + return maxAttempts < 1 ? 1 : maxAttempts; + } + + internal static global::System.TimeSpan GetRetryDelay( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::DeepInfra.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::DeepInfra.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, + global::System.Threading.CancellationToken cancellationToken) + { + if (retryDelay <= global::System.TimeSpan.Zero) + { + return; + } + + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::DeepInfra.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; + } + + internal static bool ShouldRetryStatusCode( + global::System.Net.HttpStatusCode statusCode) + { + return (int)statusCode switch + { + 408 => true, + 429 => true, + 500 => true, + 502 => true, + 503 => true, + 504 => true, + _ => false, + }; + } + + internal static string AppendQueryParameters( + string path, + global::System.Collections.Generic.Dictionary clientParameters, + global::System.Collections.Generic.Dictionary? requestParameters) + { + var hasClientParameters = clientParameters != null && clientParameters.Count > 0; + var hasRequestParameters = requestParameters != null && requestParameters.Count > 0; + if (!hasClientParameters && !hasRequestParameters) + { + return path; + } + + var builder = new global::System.Text.StringBuilder(path ?? string.Empty); + var hasQuery = builder.ToString().IndexOf("?", global::System.StringComparison.Ordinal) >= 0; + AppendParameters(builder, clientParameters, ref hasQuery); + AppendParameters(builder, requestParameters, ref hasQuery); + return builder.ToString(); + } + + internal static void ApplyHeaders( + global::System.Net.Http.HttpRequestMessage request, + global::System.Collections.Generic.Dictionary clientHeaders, + global::System.Collections.Generic.Dictionary? requestHeaders) + { + ApplyHeadersCore(request, clientHeaders); + ApplyHeadersCore(request, requestHeaders); + } + + private static void AppendParameters( + global::System.Text.StringBuilder builder, + global::System.Collections.Generic.Dictionary? parameters, + ref bool hasQuery) + { + if (parameters == null || parameters.Count == 0) + { + return; + } + + foreach (var parameter in parameters) + { + builder.Append(hasQuery ? '&' : '?'); + builder.Append(global::System.Uri.EscapeDataString(parameter.Key)); + builder.Append('='); + builder.Append(global::System.Uri.EscapeDataString(parameter.Value ?? string.Empty)); + hasQuery = true; + } + } + + private static void ApplyHeadersCore( + global::System.Net.Http.HttpRequestMessage request, + global::System.Collections.Generic.Dictionary? headers) + { + if (headers == null || headers.Count == 0) + { + return; + } + + foreach (var header in headers) + { + request.Headers.Remove(header.Key); + request.Content?.Headers.Remove(header.Key); + + if (!request.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty) && + request.Content != null) + { + request.Content.Headers.TryAddWithoutValidation(header.Key, header.Value ?? string.Empty); + } + } + } + + private static async global::System.Threading.Tasks.Task InvokeHooksAsync( + global::DeepInfra.AutoSDKClientOptions clientOptions, + global::System.Func callback, + global::DeepInfra.AutoSDKHookContext context) + { + if (clientOptions.Hooks == null || clientOptions.Hooks.Count == 0) + { + return; + } + + foreach (var hook in clientOptions.Hooks) + { + if (hook == null) + { + continue; + } + + await callback(hook, context).ConfigureAwait(false); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs index 5bb91371..ca3f8c0d 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.PathBuilder.g.cs @@ -224,6 +224,40 @@ public PathBuilder AddOptionalParameter( return this; } + /// + /// Adds a pre-serialized query string fragment to the URL. + /// + /// The serialized query string value. + /// The current instance. + public PathBuilder AddRawQueryString( + string value) + { + if (string.IsNullOrWhiteSpace(value)) + { + return this; + } + + value = value.TrimStart('?', '&'); + if (value.Length == 0) + { + return this; + } + + if (_firstParameter) + { + _stringBuilder.Append('?'); + _firstParameter = false; + } + else + { + _stringBuilder.Append('&'); + } + + _stringBuilder.Append(value); + + return this; + } + /// /// Returns the constructed URL as a string. /// @@ -241,6 +275,11 @@ public class EndPointAuthorization /// public string Type { get; set; } = string.Empty; + /// + /// + /// + public string SchemeId { get; set; } = string.Empty; + /// /// /// diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs index 92ad4e7f..b248dda1 100644 --- a/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs +++ b/src/libs/DeepInfra/Generated/DeepInfra.Polyfills.g.cs @@ -1,5 +1,4 @@ -#if !NET6_0_OR_GREATER #nullable enable namespace DeepInfra @@ -9,6 +8,7 @@ namespace DeepInfra /// public static partial class AutoSdkPolyfills { +#if !NET6_0_OR_GREATER /// /// /// @@ -48,6 +48,136 @@ public static partial class AutoSdkPolyfills content = content ?? throw new global::System.ArgumentNullException(nameof(content)); return content.ReadAsByteArrayAsync(); } +#endif + + /// + /// Creates a JSON request content instance. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Net.Http.HttpContent CreateJsonContent( + T inputValue, + string mediaType, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions) + { + if (string.IsNullOrWhiteSpace(mediaType)) + { + throw new global::System.ArgumentException("Media type is required.", nameof(mediaType)); + } + +#if NET5_0_OR_GREATER + return global::System.Net.Http.Json.JsonContent.Create( + inputValue: inputValue, + mediaType: new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType), + options: jsonSerializerOptions); +#else + var json = global::System.Text.Json.JsonSerializer.Serialize(inputValue, jsonSerializerOptions); + var stringContent = new global::System.Net.Http.StringContent( + content: json, + encoding: global::System.Text.Encoding.UTF8); + stringContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType) + { + CharSet = global::System.Text.Encoding.UTF8.WebName, + }; + return stringContent; +#endif + } + + /// + /// Creates a JSON request content instance using a source-generated serializer context. + /// + public static global::System.Net.Http.HttpContent CreateJsonContent( + object? inputValue, + global::System.Type inputType, + string mediaType, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + inputType = inputType ?? throw new global::System.ArgumentNullException(nameof(inputType)); + jsonSerializerContext = jsonSerializerContext ?? throw new global::System.ArgumentNullException(nameof(jsonSerializerContext)); + + if (string.IsNullOrWhiteSpace(mediaType)) + { + throw new global::System.ArgumentException("Media type is required.", nameof(mediaType)); + } + +#if NET5_0_OR_GREATER + var jsonTypeInfo = jsonSerializerContext.GetTypeInfo(inputType) ?? + throw new global::System.InvalidOperationException($"No JsonTypeInfo registered for '{inputType}'."); + return global::System.Net.Http.Json.JsonContent.Create( + inputValue: inputValue, + jsonTypeInfo: jsonTypeInfo, + mediaType: new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType)); +#else + var json = global::System.Text.Json.JsonSerializer.Serialize( + value: inputValue, + inputType: inputType, + jsonSerializerContext); + var stringContent = new global::System.Net.Http.StringContent( + content: json, + encoding: global::System.Text.Encoding.UTF8); + stringContent.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(mediaType) + { + CharSet = global::System.Text.Encoding.UTF8.WebName, + }; + return stringContent; +#endif + } + + /// + /// Reads JSON content into the specified type using serializer options. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static async global::System.Threading.Tasks.Task ReadFromJsonAsync( + this global::System.Net.Http.HttpContent content, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions, + global::System.Threading.CancellationToken cancellationToken) + { + content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + +#if NET5_0_OR_GREATER + return await global::System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync( + content, + jsonSerializerOptions, + cancellationToken).ConfigureAwait(false); +#else + using var stream = await AutoSdkPolyfills.ReadAsStreamAsync(content, cancellationToken).ConfigureAwait(false); + return await global::System.Text.Json.JsonSerializer.DeserializeAsync( + utf8Json: stream, + options: jsonSerializerOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); +#endif + } + + /// + /// Reads JSON content into the specified type using a source-generated serializer context. + /// + public static async global::System.Threading.Tasks.Task ReadFromJsonAsync( + this global::System.Net.Http.HttpContent content, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext, + global::System.Threading.CancellationToken cancellationToken) + { + content = content ?? throw new global::System.ArgumentNullException(nameof(content)); + jsonSerializerContext = jsonSerializerContext ?? throw new global::System.ArgumentNullException(nameof(jsonSerializerContext)); + +#if NET5_0_OR_GREATER + return (T?)await global::System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync( + content, + typeof(T), + jsonSerializerContext, + cancellationToken).ConfigureAwait(false); +#else + using var stream = await AutoSdkPolyfills.ReadAsStreamAsync(content, cancellationToken).ConfigureAwait(false); + return (T?)await global::System.Text.Json.JsonSerializer.DeserializeAsync( + utf8Json: stream, + returnType: typeof(T), + jsonSerializerContext, + cancellationToken: cancellationToken).ConfigureAwait(false); +#endif + } } } -#endif \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.Security.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.Security.g.cs new file mode 100644 index 00000000..9a71fbcc --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.Security.g.cs @@ -0,0 +1,158 @@ +#nullable enable + +namespace DeepInfra +{ + internal sealed class EndPointAuthorizationRequirement + { + internal string Type { get; set; } = string.Empty; + + internal string SchemeId { get; set; } = string.Empty; + + internal string Location { get; set; } = string.Empty; + + internal string Name { get; set; } = string.Empty; + + internal string FriendlyName { get; set; } = string.Empty; + } + + internal sealed class EndPointSecurityRequirement + { + internal global::System.Collections.Generic.IReadOnlyList Authorizations { get; set; } = + global::System.Array.Empty(); + } + + internal static class EndPointSecurityResolver + { + internal static global::System.Collections.Generic.List ResolveAuthorizations( + global::System.Collections.Generic.IReadOnlyList availableAuthorizations, + global::System.Collections.Generic.IReadOnlyList securityRequirements, + string operationName) + { + availableAuthorizations = availableAuthorizations ?? throw new global::System.ArgumentNullException(nameof(availableAuthorizations)); + securityRequirements = securityRequirements ?? throw new global::System.ArgumentNullException(nameof(securityRequirements)); + operationName = operationName ?? throw new global::System.ArgumentNullException(nameof(operationName)); + + if (securityRequirements.Count == 0) + { + return new global::System.Collections.Generic.List(); + } + + var allowsAnonymous = false; + + foreach (var requirement in securityRequirements) + { + if (requirement.Authorizations.Count == 0) + { + allowsAnonymous = true; + continue; + } + + var selected = new global::System.Collections.Generic.List(requirement.Authorizations.Count); + var satisfied = true; + + foreach (var requiredAuthorization in requirement.Authorizations) + { + var found = false; + + for (var i = 0; i < availableAuthorizations.Count; i++) + { + if (!Matches(availableAuthorizations[i], requiredAuthorization)) + { + continue; + } + + selected.Add(availableAuthorizations[i]); + found = true; + break; + } + + if (!found) + { + satisfied = false; + break; + } + } + + if (satisfied) + { + return selected; + } + } + + if (allowsAnonymous) + { + return new global::System.Collections.Generic.List(); + } + + throw new global::System.InvalidOperationException( + $"Operation '{operationName}' requires one of the configured security alternatives: {DescribeRequirements(securityRequirements)}."); + } + + private static bool Matches( + EndPointAuthorization availableAuthorization, + EndPointAuthorizationRequirement requiredAuthorization) + { + if (!string.Equals(availableAuthorization.Type, requiredAuthorization.Type, global::System.StringComparison.Ordinal)) + { + return false; + } + + return requiredAuthorization.Type switch + { + "OAuth2" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "OpenIdConnect" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "MutualTLS" => string.Equals( + availableAuthorization.SchemeId, + requiredAuthorization.SchemeId, + global::System.StringComparison.Ordinal), + "Http" => string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + "ApiKey" => string.Equals( + availableAuthorization.Location, + requiredAuthorization.Location, + global::System.StringComparison.Ordinal) && + string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + _ => string.Equals( + availableAuthorization.Location, + requiredAuthorization.Location, + global::System.StringComparison.Ordinal) && + string.Equals( + availableAuthorization.Name, + requiredAuthorization.Name, + global::System.StringComparison.Ordinal), + }; + } + + private static string DescribeRequirements( + global::System.Collections.Generic.IReadOnlyList securityRequirements) + { + var parts = new global::System.Collections.Generic.List(securityRequirements.Count); + + foreach (var requirement in securityRequirements) + { + if (requirement.Authorizations.Count == 0) + { + parts.Add("anonymous"); + continue; + } + + parts.Add(string.Join( + " + ", + global::System.Linq.Enumerable.Select(requirement.Authorizations, static x => x.FriendlyName))); + } + + return string.Join(" or ", parts); + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs new file mode 100644 index 00000000..163db95f --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.OpenaiCompletions.g.cs @@ -0,0 +1,667 @@ + +#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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it). + /// + /// + /// model name + /// + /// + /// input prompt - a single string is currently supported + /// + /// + /// The maximum number of tokens to generate in the completion.
+ /// The total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller. + /// + /// + /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic
+ /// Default Value: 1F + /// + /// + /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
+ /// Default Value: 1F + /// + /// + /// Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
+ /// Default Value: 0F + /// + /// + /// Sample from the best k (number of) tokens. 0 means off
+ /// Default Value: 0 + /// + /// + /// number of sequences to return
+ /// Default Value: 1 + /// + /// + /// whether to stream the output via SSE or return the full response
+ /// Default Value: false + /// + /// + /// return top tokens and their log-probabilities + /// + /// + /// return prompt as part of the respons + /// + /// + /// up to 16 sequences where the API will stop generating further tokens + /// + /// + /// Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.
+ /// Default Value: 0 + /// + /// + /// The format of the response. Currently, only json is supported. + /// + /// + /// Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)
+ /// Default Value: 1 + /// + /// + /// A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers. + /// + /// + /// Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed. + /// + /// + /// streaming options + /// + /// + /// Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments. + /// + /// + /// return tokens as token ids + /// + /// + /// A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key. + /// + /// + /// Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...'). + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task OpenaiCompletionsAsync( + string model, + global::DeepInfra.AnyOf> prompt, + string? xDeepinfraSource = default, + string? xiApiKey = default, + string? xApiKey = default, + global::DeepInfra.ServiceTier? serviceTier = default, + int? maxTokens = default, + double? temperature = default, + double? topP = default, + double? minP = default, + int? topK = default, + int? n = default, + bool? stream = default, + int? logprobs = default, + bool? echo = default, + global::DeepInfra.AnyOf, object>? stop = default, + double? presencePenalty = default, + double? frequencyPenalty = default, + global::DeepInfra.AnyOf? responseFormat = default, + double? repetitionPenalty = default, + string? user = default, + int? seed = default, + global::DeepInfra.StreamOptions? streamOptions = default, + global::System.Collections.Generic.IList? stopTokenIds = default, + bool? returnTokensAsTokenIds = default, + string? promptCacheKey = default, + global::DeepInfra.CompletionMultiModalData? data = default, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::DeepInfra.OpenAICompletionsIn + { + ServiceTier = serviceTier, + 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, + 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..28b87560 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextCompletionsClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// OpenAI-compatible text completion endpoints.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class TextCompletionsClient : global::DeepInfra.ITextCompletionsClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the TextCompletionsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public TextCompletionsClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the TextCompletionsClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public TextCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the TextCompletionsClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public TextCompletionsClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs new file mode 100644 index 00000000..b04651f3 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.CreateVoice.g.cs @@ -0,0 +1,1691 @@ + +#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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Description ?? string.Empty), + name: "\"description\""); + + for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++) + { + var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"file{__iFiles}.bin\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Description ?? string.Empty), + name: "\"description\""); + + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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(); + if (xiApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xiApiKey ?? string.Empty), + name: "\"xi-api-key\""); + + } + if (xApiKey != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(xApiKey ?? string.Empty), + name: "\"x-api-key\""); + + } + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Name ?? string.Empty), + name: "\"name\""); + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(request.Description ?? string.Empty), + name: "\"description\""); + + for (var __iFiles = 0; __iFiles < files.Count; __iFiles++) + { + var __fileNameFiles = filesFileNames != null && + __iFiles < filesFileNames.Count && + filesFileNames[__iFiles] != null + ? filesFileNames[__iFiles] + : $"file{__iFiles}.bin"; + var __contentFiles = new global::System.Net.Http.StreamContent(files[__iFiles]); + __contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( + __fileNameFiles is null + ? "application/octet-stream" + : (global::System.IO.Path.GetExtension(__fileNameFiles) ?? string.Empty).ToLowerInvariant() switch + { + ".aac" => "audio/aac", + ".flac" => "audio/flac", + ".gif" => "image/gif", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".json" => "application/json", + ".m4a" => "audio/mp4", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".mpeg" => "audio/mpeg", + ".mpga" => "audio/mpeg", + ".oga" => "audio/ogg", + ".ogg" => "audio/ogg", + ".opus" => "audio/ogg", + ".pdf" => "application/pdf", + ".png" => "image/png", + ".txt" => "text/plain", + ".wav" => "audio/wav", + ".weba" => "audio/webm", + ".webm" => "video/webm", + ".webp" => "image/webp", + _ => "application/octet-stream", + }); + __httpRequestContent.Add( + content: __contentFiles, + name: "\"files\"", + fileName: $"\"{__fileNameFiles}\""); + if (__contentFiles.Headers.ContentDisposition != null) + { + __contentFiles.Headers.ContentDisposition.FileNameStar = null; + } + } + + __httpRequest.Content = __httpRequestContent; + + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + xiApiKey: xiApiKey, + 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..ce69050a --- /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..c479445e --- /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..cc63f453 --- /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..fea16062 --- /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..51bce36e --- /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..680d5d33 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.UpdateVoice.g.cs @@ -0,0 +1,617 @@ + +#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 __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/x-www-form-urlencoded"); + __httpRequest.Content = __httpRequestContent; + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateVoiceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + voiceId: voiceId!, + xiApiKey: xiApiKey, + 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..38b73a24 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TextToSpeechClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// ElevenLabs-compatible TTS endpoints and voice management.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class TextToSpeechClient : global::DeepInfra.ITextToSpeechClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the TextToSpeechClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public TextToSpeechClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the TextToSpeechClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public TextToSpeechClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the TextToSpeechClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public TextToSpeechClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Detokenize.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.Detokenize.g.cs new file mode 100644 index 00000000..dac735d4 --- /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..e1d9a8c7 --- /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..7a2ea96b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.TokenizerClient.g.cs @@ -0,0 +1,136 @@ + +#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; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// 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..3a76e68d --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.CliVersion.g.cs @@ -0,0 +1,460 @@ + +#nullable enable + +namespace DeepInfra +{ + public partial class UtilitiesClient + { + + + private static readonly global::DeepInfra.EndPointSecurityRequirement s_CliVersionSecurityRequirement0 = + new global::DeepInfra.EndPointSecurityRequirement + { + Authorizations = new global::DeepInfra.EndPointAuthorizationRequirement[] + { new global::DeepInfra.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::DeepInfra.EndPointSecurityRequirement[] s_CliVersionSecurityRequirements = + new global::DeepInfra.EndPointSecurityRequirement[] + { s_CliVersionSecurityRequirement0, + }; + partial void PrepareCliVersionArguments( + global::System.Net.Http.HttpClient httpClient, + ref string version); + partial void PrepareCliVersionRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string version); + partial void ProcessCliVersionResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCliVersionResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Cli Version + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CliVersionAsync( + string version, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CliVersionAsResponseAsync( + version: version, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cli Version + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CliVersionAsResponseAsync( + string version, + global::DeepInfra.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareCliVersionArguments( + httpClient: HttpClient, + version: ref version); + + + var __authorizations = global::DeepInfra.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CliVersionSecurityRequirements, + operationName: "CliVersionAsync"); + + using var __timeoutCancellationTokenSource = global::DeepInfra.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::DeepInfra.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::DeepInfra.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::DeepInfra.PathBuilder( + path: "/cli/version", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("version", version) + ; + var __path = __pathBuilder.ToString(); + __path = global::DeepInfra.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::DeepInfra.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCliVersionRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + version: version!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::DeepInfra.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::DeepInfra.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::DeepInfra.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCliVersionResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::DeepInfra.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::DeepInfra.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CliVersion", + methodName: "CliVersionAsync", + pathTemplate: "\"/cli/version\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Validation Error + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::DeepInfra.HTTPValidationError? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::DeepInfra.HTTPValidationError.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCliVersionResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::DeepInfra.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::DeepInfra.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::DeepInfra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.SubmitFeedback.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.SubmitFeedback.g.cs new file mode 100644 index 00000000..abc9fe39 --- /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..11b10bd7 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.UtilitiesClient.g.cs @@ -0,0 +1,137 @@ + +#nullable enable + +namespace DeepInfra +{ + /// + /// Feedback submission and CLI version.
+ /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class UtilitiesClient : global::DeepInfra.IUtilitiesClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://api.deepinfra.com/"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::DeepInfra.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the UtilitiesClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public UtilitiesClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the UtilitiesClient with explicit options but no base URL override. + /// Skips passing baseUri so the default base URL from the OpenAPI spec applies. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public UtilitiesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) : this( + httpClient, + baseUri: null, + authorizations, + options, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the UtilitiesClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public UtilitiesClient( + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::DeepInfra.AutoSDKClientOptions? options, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::DeepInfra.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration.g.cs b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration.g.cs new file mode 100644 index 00000000..fd898d54 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration.g.cs @@ -0,0 +1,549 @@ + +#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 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides 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, + 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, + }; + + 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..6dc89f0b --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.CreateVideoGeneration2.g.cs @@ -0,0 +1,549 @@ + +#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 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Per-request overrides 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, + 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, + }; + + 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..dbe13a50 --- /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..cc71199a --- /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..050d03db --- /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..e5179010 --- /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..a97809b2 --- /dev/null +++ b/src/libs/DeepInfra/Generated/DeepInfra.VideosClient.g.cs @@ -0,0 +1,136 @@ + +#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; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::DeepInfra.SourceGenerationContext.Default; + + + /// + /// 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..0e2d7369 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/me/gpu_limit":{"get":{"tags":["Account"],"summary":"Account Gpu Limit","operationId":"account_gpu_limit_v1_me_gpu_limit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/GpuLimitOut"}}}},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/gpu_limit/request":{"post":{"tags":["Account"],"summary":"Request Gpu Limit Increase","operationId":"request_gpu_limit_increase_v1_me_gpu_limit_request_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/GpuLimitRequestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/deploy/hf/":{"post":{"tags":["Dedicated Models"],"summary":"Deploy Create Hf","operationId":"deploy_create_hf_deploy_hf__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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-tested preset deploy configs for ``hf_repo_id`` (HF org/name), for\nthe deploy dashboard to pre-fill. An empty list — the common case — means none.\nOmit ``engine`` to get presets across all engines.","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":"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,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"}},{"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,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"}},{"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"},"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"},"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}/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"},"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"},"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"},"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"}}}}}}},"/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":"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"}}}}}}},"/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"},"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"}}}}}}},"/github/login":{"get":{"tags":["Authentication"],"summary":"Github Login","description":"Initiate github SSO login flow. Callback is /github/callback","operationId":"github_login_github_login_get","parameters":[{"name":"login_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"deal","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal"}},{"name":"ti_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ti Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/okta/login":{"get":{"tags":["Authentication"],"summary":"Okta Login","operationId":"okta_login_okta_login_get","parameters":[{"name":"team_id","in":"query","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"origin","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"}},{"name":"login_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/github/cli/login":{"get":{"tags":["Authentication"],"summary":"Github Cli Login","description":"deepctl is calling this request waiting for auth token during login.\nThe token is stored in /github/callback","operationId":"github_cli_login_github_cli_login_get","parameters":[{"name":"login_id","in":"query","required":true,"schema":{"type":"string","title":"Login Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-tokens":{"get":{"tags":["Authentication"],"summary":"Get Api Tokens","operationId":"get_api_tokens_v1_api_tokens_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":100,"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"}}}}}}},"/v1/agents":{"post":{"tags":["Agents"],"summary":"Openclaw Create","operationId":"openclaw_create_v1_agents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/OpenClawCreateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenClawCreateOut"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Payment Required"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Service Unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Agents"],"summary":"Openclaw List","operationId":"openclaw_list_v1_agents_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"enum":["active","inactive","all"],"type":"string","description":"Which instances to return: active, inactive, or all (both)","default":"active","title":"State"},"description":"Which instances to return: active, inactive, or all (both)"},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/OpenClawInstanceOut"},"title":"Response Openclaw List V1 Agents Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/catalog":{"get":{"tags":["Agents"],"summary":"Openclaw Catalog","operationId":"openclaw_catalog_v1_agents_catalog_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/OpenClawCatalogOut"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}":{"get":{"tags":["Agents"],"summary":"Openclaw Get","operationId":"openclaw_get_v1_agents__instance_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/OpenClawInstanceOut"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Agents"],"summary":"Openclaw Update","operationId":"openclaw_update_v1_agents__instance_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/OpenClawUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agents"],"summary":"Openclaw Delete","operationId":"openclaw_delete_v1_agents__instance_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":"Openclaw Launch Token","description":"Mint a single-use launch URL for the dashboard.\n\nCalled by the launcher page right when readyz flips ready. The launch URL\nis used as a top-level navigation; /launch then sets the oc_auth cookie\nand 302s into the proxied dashboard.\n\nThe user's bearer token is stashed in Redis under the token's jti and\nretrieved (atomic GETDEL) on /launch redeem — this keeps the bearer out of\nthe URL and out of any signed payload while preserving the existing proxy\nauth flow (oc_auth cookie value = bearer token).\n\nRefuses instances whose agent_type has has_dashboard=False (e.g. hermes).","operationId":"openclaw_launch_token_v1_agents__instance_id__launch_token_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":"Openclaw Stop","operationId":"openclaw_stop_v1_agents__instance_id__stop_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":"Openclaw Start","operationId":"openclaw_start_v1_agents__instance_id__start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":"Openclaw Update Version","operationId":"openclaw_update_version_v1_agents__instance_id__update_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":"Openclaw List Backups","operationId":"openclaw_list_backups_v1_agents__instance_id__backups_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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/OpenClawBackupOut"},"title":"Response Openclaw List Backups V1 Agents Instance Id Backups Get"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepError"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{instance_id}/backup":{"post":{"tags":["Agents"],"summary":"Openclaw Trigger Backup","operationId":"openclaw_trigger_backup_v1_agents__instance_id__backup_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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":"Openclaw Restore Backup","operationId":"openclaw_restore_backup_v1_agents__instance_id__backups__backup_id__restore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"string","title":"Instance Id"}},{"name":"backup_id","in":"path","required":true,"schema":{"type":"string","title":"Backup Id"}},{"name":"xi-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xi-Api-Key"}},{"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"}}}}}}},"/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"},"AgentInstanceState":{"type":"string","enum":["creating","starting","running","stopping","stopped","failed","deleted"],"title":"AgentInstanceState"},"AnthropicMessagesIn":{"properties":{"model":{"type":"string","title":"Model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AnthropicSystemContent"},"type":"array"},{"type":"null"}],"title":"System"},"stop_sequences":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop Sequences"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","default":false},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":1.0},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"top_k":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top K"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnthropicTool"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"},"thinking":{"anyOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}]}},"type":"object","required":["model","messages"],"title":"AnthropicMessagesIn"},"AnthropicSystemContent":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","title":"Text"}},"type":"object","required":["type","text"],"title":"AnthropicSystemContent"},"AnthropicThinkingConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","title":"AnthropicThinkingConfig"},"AnthropicTokenCountRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"system":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/AnthropicSystemContent"},"type":"array"},{"type":"null"}],"title":"System"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/AnthropicTool"},"type":"array"},{"type":"null"}],"title":"Tools"},"thinking":{"anyOf":[{"$ref":"#/components/schemas/AnthropicThinkingConfig"},{"type":"null"}]},"tool_choice":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Choice"}},"type":"object","required":["model","messages"],"title":"AnthropicTokenCountRequest"},"AnthropicTool":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","input_schema"],"title":"AnthropicTool"},"ApiToken":{"properties":{"token":{"type":"string","title":"Token"},"created_at":{"type":"integer","title":"Created At","description":"creation unix timestamp"},"name":{"type":"string","title":"Name"},"token_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id"},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ips"}},"type":"object","required":["token","created_at","name"],"title":"ApiToken"},"ApiTokenIn":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ApiTokenIn"},"ApiTokenVercelExportIn":{"properties":{"project_id_or_name":{"type":"string","title":"Project Id Or Name"},"is_sensitive":{"type":"boolean","title":"Is Sensitive"},"env_development":{"type":"boolean","title":"Env Development"},"env_preview":{"type":"boolean","title":"Env Preview"},"env_production":{"type":"boolean","title":"Env Production"}},"type":"object","required":["project_id_or_name","is_sensitive","env_development","env_preview","env_production"],"title":"ApiTokenVercelExportIn"},"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"}},"type":"object","required":["file","model"],"title":"Body_openai_audio_transcriptions_v1_audio_transcriptions_post"},"Body_openai_audio_translations_v1_audio_translations_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string","enum":["json","verbose_json","text","srt","vtt"]},{"type":"null"}],"title":"Response Format","default":"json"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0}},"type":"object","required":["file","model"],"title":"Body_openai_audio_translations_v1_audio_translations_post"},"Body_openai_files_v1_files_post":{"properties":{"purpose":{"type":"string","title":"Purpose"},"file":{"items":{"type":"string","format":"binary"},"type":"array","title":"File"}},"type":"object","required":["purpose","file"],"title":"Body_openai_files_v1_files_post"},"Body_openai_images_edits_v1_images_edits_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesEditsIn"},{"type":"null"}]},"prompt":{"type":"string","title":"Prompt"},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","prompt","model"],"title":"Body_openai_images_edits_v1_images_edits_post"},"Body_openai_images_variations_v1_images_variations_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"inp":{"anyOf":[{"$ref":"#/components/schemas/OpenAIImagesVariationsIn"},{"type":"null"}]},"model":{"type":"string","title":"Model"}},"type":"object","required":["image","model"],"title":"Body_openai_images_variations_v1_images_variations_post"},"Body_update_voice_v1_voices__voice_id__edit_post":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"Body_update_voice_v1_voices__voice_id__edit_post"},"ChatCompletionAssistantMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"assistant","title":"Role","description":"the role of the author of this message","default":"assistant"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"},{"type":"null"}],"title":"Content","description":"the message content"},"reasoning_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasoning Content","description":"the reasoning content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatCompletionMessageToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"the tool calls generated by the mode"}},"type":"object","title":"ChatCompletionAssistantMessage"},"ChatCompletionContentPartAudio":{"properties":{"type":{"type":"string","const":"input_audio","title":"Type"},"input_audio":{"$ref":"#/components/schemas/InputAudio"}},"type":"object","required":["type","input_audio"],"title":"ChatCompletionContentPartAudio"},"ChatCompletionContentPartImage":{"properties":{"type":{"type":"string","const":"image_url","title":"Type"},"image_url":{"$ref":"#/components/schemas/ImageURL"}},"type":"object","required":["type","image_url"],"title":"ChatCompletionContentPartImage"},"ChatCompletionContentPartText":{"properties":{"type":{"type":"string","const":"text","title":"Type"},"text":{"type":"string","title":"Text"}},"type":"object","required":["type","text"],"title":"ChatCompletionContentPartText"},"ChatCompletionContentPartVideo":{"properties":{"type":{"type":"string","const":"video_url","title":"Type"},"video_url":{"$ref":"#/components/schemas/VideoURL"}},"type":"object","required":["type","video_url"],"title":"ChatCompletionContentPartVideo"},"ChatCompletionMessageToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"the id of the tool call"},"type":{"type":"string","title":"Type","description":"the type of the tool call. only function is supported currently"},"function":{"$ref":"#/components/schemas/Function","description":"the function that the model called"}},"type":"object","required":["id","type","function"],"title":"ChatCompletionMessageToolCall"},"ChatCompletionSystemMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"system","title":"Role","description":"the role of the author of this message","default":"system"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"}],"title":"Content","description":"the message content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["content"],"title":"ChatCompletionSystemMessage"},"ChatCompletionToolMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"tool","title":"Role","description":"the role of the author of this message","default":"tool"},"content":{"anyOf":[{"type":"string"},{"items":{"$ref":"#/components/schemas/ChatCompletionContentPartText"},"type":"array"}],"title":"Content","description":"the message content"},"tool_call_id":{"type":"string","title":"Tool Call Id"}},"type":"object","required":["content","tool_call_id"],"title":"ChatCompletionToolMessage"},"ChatCompletionUserMessage":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"role":{"type":"string","const":"user","title":"Role","description":"the role of the author of this message","default":"user"},"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionContentPartText"},{"$ref":"#/components/schemas/ChatCompletionContentPartImage"},{"$ref":"#/components/schemas/ChatCompletionContentPartAudio"},{"$ref":"#/components/schemas/ChatCompletionContentPartVideo"}]},"type":"array"}],"title":"Content","description":"the message content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["content"],"title":"ChatCompletionUserMessage"},"ChatReasoningSettings":{"properties":{"effort":{"anyOf":[{"type":"string","enum":["low","medium","high","xhigh"]},{"type":"null"}],"title":"Effort","description":"Constrains effort on reasoning for reasoning models."},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Enable or disable reasoning with default parameters."}},"type":"object","title":"ChatReasoningSettings"},"ChatTools":{"properties":{"cache_control":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Cache Control","description":"Cache control for prompt caching"},"type":{"type":"string","title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/FunctionDefinition"}},"type":"object","required":["function"],"title":"ChatTools"},"CompletionMultiModalData":{"properties":{"image":{"items":{"type":"string"},"type":"array","title":"Image","description":"List of images as base64 data URIs (e.g. 'data:image/png;base64,...'). Each image must correspond to a placeholder token in the prompt."},"video":{"items":{"type":"string"},"type":"array","title":"Video","description":"List of videos as base64 data URIs (e.g. 'data:video/mp4;base64,...'). Each video must correspond to a placeholder token in the prompt."}},"type":"object","title":"CompletionMultiModalData"},"ContainerRentalOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"state":{"$ref":"#/components/schemas/ContainerRentalStateOut"},"start_ts":{"type":"integer","title":"Start Ts"},"state_ts":{"type":"integer","title":"State Ts"},"stop_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stop Ts"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"gpu_config":{"type":"string","title":"Gpu Config"},"price_per_hour":{"type":"number","title":"Price Per Hour"},"container_image":{"type":"string","title":"Container Image"},"fail_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fail Reason"}},"type":"object","required":["id","name","state","start_ts","state_ts","stop_ts","ip","gpu_config","price_per_hour","container_image","fail_reason"],"title":"ContainerRentalOut"},"ContainerRentalStartIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Container Name"},"gpu_config":{"type":"string","minLength":1,"title":"Gpu Config","description":"GPU config"},"container_image":{"type":"string","minLength":1,"title":"Container Image","description":"Container Image"},"cloud_init_user_data":{"type":"string","maxLength":32000,"minLength":1,"title":"Cloud Init User Data","description":"Cloud Init User Data"}},"type":"object","required":["name","gpu_config","container_image","cloud_init_user_data"],"title":"ContainerRentalStartIn"},"ContainerRentalStartOut":{"properties":{"container_id":{"type":"string","title":"Container Id","description":"Container Id"}},"type":"object","required":["container_id"],"title":"ContainerRentalStartOut"},"ContainerRentalStateOut":{"type":"string","enum":["creating","starting","running","shutting_down","failed","deleted"],"title":"ContainerRentalStateOut"},"ContainerRentalUpdateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Container Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ContainerRentalUpdateIn"},"CreateLoraApiRequest":{"properties":{"base_model":{"type":"string","title":"Base Model"},"lora_name":{"type":"string","title":"Lora Name"},"source":{"$ref":"#/components/schemas/SourceModel"},"private":{"type":"boolean","title":"Private"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""}},"type":"object","required":["base_model","lora_name","source","private"],"title":"CreateLoraApiRequest"},"DeepError":{"properties":{"error":{"type":"string","title":"Error","description":"Error","examples":["Model not found"]}},"type":"object","required":["error"],"title":"DeepError"},"DeployDelete":{"properties":{"deploy_id":{"type":"string","title":"Deploy Id","description":"Deploy Id","examples":["fkj843kjh8"]}},"type":"object","required":["deploy_id"],"title":"DeployDelete"},"DeployGPUAvailability":{"properties":{"gpus":{"items":{"$ref":"#/components/schemas/GPUAvailabilityInfo"},"type":"array","title":"Gpus","description":"A list of all provided GPUs configurations, including their price and wether they are available"}},"type":"object","required":["gpus"],"title":"DeployGPUAvailability"},"DeployGPUs":{"type":"string","enum":["L4-24GB","L40S-48GB","A100-80GB","H100-80GB","H200-141GB","B200-180GB","B300-270GB","RTXPRO6000-96GB","other"],"title":"DeployGPUs"},"DeployInstances":{"properties":{"running":{"type":"integer","title":"Running"},"pending":{"type":"integer","title":"Pending"}},"type":"object","required":["running","pending"],"title":"DeployInstances"},"DeployLLMConfig":{"properties":{"gpu":{"$ref":"#/components/schemas/DeployGPUs","description":"The type of GPU the deployment is running on"},"num_gpus":{"type":"integer","title":"Num Gpus","description":"Number of GPUs used by one instance"},"max_batch_size":{"type":"integer","title":"Max Batch Size","description":"Maximum number of concurrent requests"},"weights":{"anyOf":[{"$ref":"#/components/schemas/HFWeights"},{"type":"null"}],"description":"Model weights information"}},"type":"object","required":["gpu","num_gpus","max_batch_size"],"title":"DeployLLMConfig"},"DeployLLMIn":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"model name for deepinfra (username/mode-name format)"},"gpu":{"$ref":"#/components/schemas/DeployGPUs","description":"The type of GPU the deployment is running on."},"num_gpus":{"type":"integer","maximum":8.0,"minimum":1.0,"title":"Num Gpus","description":"Number of GPUs used by one instance","default":1},"max_batch_size":{"type":"integer","maximum":256.0,"minimum":1.0,"title":"Max Batch Size","description":"Maximum number of concurrent requests","default":96},"hf":{"anyOf":[{"$ref":"#/components/schemas/HFWeights"},{"type":"null"}]},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model","description":"Base public model"},"container_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Container Image","description":"Docker image for the deployment (e.g. vllm/vllm-openai:v0.8.4)"},"settings":{"anyOf":[{"$ref":"#/components/schemas/ScaleSettings"},{"type":"null"}]},"extra_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extra Args","description":"Extra command line arguments for custom deployments"},"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."},"preset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preset Id","description":"Apply a DeepInfra preset (base_model deploys only)."}},"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"},"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":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"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)"}},"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"},"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","text-to-music","rent-container","bare-metal","reranker","openclaw","hermes","world-model"],"title":"HFTasksE"},"HFWeights":{"properties":{"repo":{"type":"string","title":"Repo","description":"huggingface repository i.e username/reponame"},"revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision","description":"commit sha or branch name"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token","description":"huggingface access token with read access to the repo"}},"type":"object","required":["repo"],"title":"HFWeights"},"HardwareOption":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["serverless","dedicated"],"title":"Type"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/HardwarePricingServerless"},{"$ref":"#/components/schemas/HardwarePricingDedicated"}],"title":"Pricing"}},"type":"object","required":["id","name","type","pricing"],"title":"HardwareOption"},"HardwarePricingDedicated":{"properties":{"cents_per_minute":{"type":"number","title":"Cents Per Minute"}},"type":"object","required":["cents_per_minute"],"title":"HardwarePricingDedicated"},"HardwarePricingServerless":{"properties":{"cents_per_million_input_tokens":{"type":"number","title":"Cents Per Million Input Tokens"},"cents_per_million_output_tokens":{"type":"number","title":"Cents Per Million Output Tokens"}},"type":"object","required":["cents_per_million_input_tokens","cents_per_million_output_tokens"],"title":"HardwarePricingServerless"},"HardwareResponse":{"properties":{"hardware":{"items":{"$ref":"#/components/schemas/HardwareOption"},"type":"array","title":"Hardware"}},"type":"object","title":"HardwareResponse"},"ImageURL":{"properties":{"url":{"type":"string","title":"Url"},"detail":{"type":"string","enum":["auto","low","high"],"title":"Detail","default":"auto"}},"type":"object","required":["url"],"title":"ImageURL"},"InputAudio":{"properties":{"data":{"type":"string","title":"Data"},"format":{"type":"string","enum":["wav","mp3"],"title":"Format","default":"wav"}},"type":"object","required":["data"],"title":"InputAudio"},"InspectScopedJWTOut":{"properties":{"expires_at":{"type":"integer","title":"Expires At","description":"unix timestamp of when the token expires"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"which models is the token limited to"},"spending_limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spending Limit","description":"how much is the total spending limit set at creation"}},"type":"object","required":["expires_at"],"title":"InspectScopedJWTOut"},"JsonObjectResponseFormat":{"properties":{"type":{"type":"string","const":"json_object","title":"Type","default":"json_object"}},"type":"object","title":"JsonObjectResponseFormat"},"JsonSchema":{"properties":{"name":{"type":"string","title":"Name","description":"Name identifier for the JSON schema"},"schema":{"additionalProperties":true,"type":"object","title":"Schema","description":"The actual JSON schema definition"}},"type":"object","required":["name","schema"],"title":"JsonSchema"},"JsonSchemaResponseFormat":{"properties":{"type":{"type":"string","const":"json_schema","title":"Type","default":"json_schema"},"json_schema":{"$ref":"#/components/schemas/JsonSchema","description":"JSON schema for structured output when type is 'json_schema'"}},"type":"object","required":["json_schema"],"title":"JsonSchemaResponseFormat"},"LLMDeploymentStatsOut":{"properties":{"requests":{"type":"integer","title":"Requests","description":"number of inference requests in the provided interval"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"number of input tokens generated"},"output_tokens":{"type":"integer","title":"Output Tokens","description":"number of output tokens generated"},"avg_ttft_ms":{"type":"number","title":"Avg Ttft Ms","description":"average millisecond time to first token"},"avg95_ttft_ms":{"type":"number","title":"Avg95 Ttft Ms","description":"95th percentile time to first token (estimated)"},"avg_tpt_ms":{"type":"number","title":"Avg Tpt Ms","description":"average millisecond time per token"},"avg95_tpt_ms":{"type":"number","title":"Avg95 Tpt Ms","description":"95th percentile time per token (estimated)"},"total_amount_cents":{"type":"integer","title":"Total Amount Cents","description":"total number of cents spent"},"errors":{"type":"integer","title":"Errors","description":"number of errors"}},"type":"object","required":["requests","input_tokens","output_tokens","avg_ttft_ms","avg95_ttft_ms","avg_tpt_ms","avg95_tpt_ms","total_amount_cents","errors"],"title":"LLMDeploymentStatsOut"},"LogEntry":{"prefixItems":[{"type":"string","title":"Ts","description":"timestamp in fractional seconds since unix epoch (ns precision)"},{"type":"string","title":"Line","description":"a single log line"}],"type":"array","maxItems":2,"minItems":2},"LogQueryOut":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LogEntry"},"type":"array","title":"Entries","description":"list of log lines ordered by increasing timestamp"}},"type":"object","title":"LogQueryOut"},"LoraModelUploadIn":{"properties":{"hf_model_name":{"type":"string","title":"Hf Model Name"},"hf_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hf Token"},"lora_model_name":{"type":"string","title":"Lora Model Name"},"base_model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model Name"}},"type":"object","required":["hf_model_name","lora_model_name"],"title":"LoraModelUploadIn"},"Me":{"properties":{"uid":{"type":"string","title":"Uid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"account_setup":{"type":"boolean","title":"Account Setup"},"require_email_verified":{"type":"boolean","title":"Require Email Verified","default":false},"display_name":{"type":"string","title":"Display Name","description":"Name that is used to identifythe account on the website"},"provider":{"type":"string","title":"Provider","description":"Authentication provider, e.g. 'github'"},"picture":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Picture"},"is_admin":{"type":"boolean","title":"Is Admin"},"can_access_agents":{"type":"boolean","title":"Can Access Agents","description":"Whether the user may use the hosted-agents feature (admins, plus the AGENTS_ACCESS_UIDS allowlist)","default":false},"name":{"type":"string","title":"Name","description":"Personal name"},"first_name":{"type":"string","title":"First Name","description":"First name of the user"},"last_name":{"type":"string","title":"Last Name","description":"Last name of the user"},"country":{"type":"string","title":"Country","description":"Country of the user"},"is_business_account":{"type":"boolean","title":"Is Business Account"},"company":{"type":"string","title":"Company","description":"Company name"},"website":{"type":"string","title":"Website","description":"Company website address"},"title":{"type":"string","title":"Title","description":"Job title of the user, e.g. 'Software Engineer'"},"is_team_account":{"type":"boolean","title":"Is Team Account","default":false},"is_team_owner":{"type":"boolean","title":"Is Team Owner","default":false},"team_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Role"},"team_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Display Name"},"is_team_upgrade_enabled":{"type":"boolean","title":"Is Team Upgrade Enabled","default":true},"vercel_connection":{"anyOf":[{"$ref":"#/components/schemas/MeVercelConnection"},{"type":"null"}]},"checklist":{"anyOf":[{"$ref":"#/components/schemas/Checklist"},{"type":"null"}]}},"type":"object","required":["uid","email","email_verified","account_setup","display_name","provider","picture","is_admin","name","first_name","last_name","country","is_business_account","company","website","title"],"title":"Me"},"MeIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Name","description":"Personal name"},"first_name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"First Name","description":"First name of the user"},"last_name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Last Name","description":"Last name of the user"},"country":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Country","description":"Country of the user"},"email":{"anyOf":[{"type":"string","maxLength":320,"minLength":1},{"type":"null"}],"title":"Email"},"is_business_account":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Business Account"},"company":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Company","description":"Company name"},"website":{"anyOf":[{"type":"string","maxLength":128,"minLength":0},{"type":"null"}],"title":"Website","description":"Company website address"},"title":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Title","description":"Job title of the user, e.g. 'Software Engineer'"},"display_name":{"anyOf":[{"type":"string","maxLength":39,"minLength":1,"pattern":"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"},{"type":"null"}],"title":"Display Name","description":"String with length between 1 and 39 characters. Only alphanumeric characters and dashes allowed. Must contain no leading, trailing or consecutive dashes."},"use_case":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Use Case","description":"Short description of the use case for the account"},"attribution":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Attribution","description":"Short description of how the user found out about DeepInfra"},"marketing_emails":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Marketing Emails","description":"Set to false to opt out of marketing emails"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code","description":"ISO 3166-1 alpha-2 country code of the user selected country"}},"type":"object","title":"MeIn"},"MeVercelConnection":{"properties":{"user_id":{"type":"string","title":"User Id"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"installation_id":{"type":"string","title":"Installation Id"}},"type":"object","required":["user_id","installation_id"],"title":"MeVercelConnection"},"ModelDocBlock":{"properties":{"key":{"$ref":"#/components/schemas/ModelDocBlockKey"},"url":{"type":"string","title":"Url"}},"type":"object","required":["key","url"],"title":"ModelDocBlock"},"ModelDocBlockKey":{"type":"string","enum":["http","http-bge-m3-multimodal","http-bagel-multimodal","deepctl","js-text-gen","js-emb","js-text-to-img","js-speech-to-text","openai-python","openai-python-short","openai-http","openai-js","openai-js-short","openai-speech-http","openai-speech-python","openai-speech-js","openai-images-http","openai-images-python","openai-images-js","openai-images-variations-http","openai-images-variations-python","openai-images-variations-js","openai-images-edits-http","openai-images-edits-python","openai-images-edits-js","openai-comp-python","openai-comp-python-short","openai-comp-http","openai-comp-js","openai-comp-js-short","openai-emb-py","openai-emb-http","openai-emb-js","openai-tts-http","openai-tts-python","openai-tts-js","elevenlabs-tts-http","elevenlabs-tts-python","elevenlabs-tts-js","create-voice-http","create-voice-python","create-voice-js","read-voice-http","read-voice-python","read-voice-js","update-voice-http","update-voice-python","update-voice-js","delete-voice-http","delete-voice-python","delete-voice-js","list-voices-http","list-voices-python","list-voices-js","ai-sdk-js","ai-sdk-js-short"],"title":"ModelDocBlockKey"},"ModelFamilyOut":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Model family name"},"title":{"type":"string","title":"Title","description":"Model family title"},"description":{"type":"string","title":"Description","description":"Model family description"},"developer":{"type":"string","title":"Developer","description":"Model family developer organization"},"meta_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Title","description":"Meta title for SEO"},"meta_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Description","description":"Meta description for SEO"},"featured_models":{"items":{"type":"string"},"type":"array","title":"Featured Models"},"pp_sections_out":{"items":{"$ref":"#/components/schemas/PricingPageSectionOut"},"type":"array","title":"Pp Sections Out"},"faq_entries":{"items":{"$ref":"#/components/schemas/FAQEntryOut"},"type":"array","title":"Faq Entries","description":"List of FAQ entries for this model family, ordered by their order field"}},"type":"object","required":["name","title","description","developer","featured_models","pp_sections_out"],"title":"ModelFamilyOut"},"ModelFieldInfo":{"properties":{"name":{"type":"string","title":"Name"},"parent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent"},"ftype":{"type":"string","title":"Ftype"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"allowed":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Allowed"},"default":{"title":"Default"},"examples":{"items":{},"type":"array","title":"Examples","default":[]},"minimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Minimum"},"exclusiveMinimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exclusiveminimum"},"maximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Maximum"},"exclusiveMaximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exclusivemaximum"}},"type":"object","required":["name","ftype"],"title":"ModelFieldInfo"},"ModelInfoOut":{"properties":{"model_name":{"type":"string","title":"Model Name"},"type":{"type":"string","title":"Type"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"reported_type":{"type":"string","title":"Reported Type"},"version":{"type":"string","title":"Version"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"mf_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Description"},"featured":{"type":"boolean","title":"Featured"},"owner":{"type":"boolean","title":"Owner","default":false},"public":{"type":"boolean","title":"Public"},"curl_inv":{"type":"string","title":"Curl Inv"},"cmdline_inv":{"type":"string","title":"Cmdline Inv"},"txt_docs":{"type":"string","title":"Txt Docs"},"out_example":{"type":"string","title":"Out Example"},"out_docs":{"type":"string","title":"Out Docs"},"in_schema":{"title":"In Schema"},"out_schema":{"title":"Out Schema"},"in_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/ModelFieldInfo"},"type":"array"},{"type":"null"}],"title":"In Fields"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"},{"$ref":"#/components/schemas/ModelPricingFrameUnits"}],"title":"Pricing"},"doc_blocks":{"anyOf":[{"items":{"$ref":"#/components/schemas/ModelDocBlock"},"type":"array"},{"type":"null"}],"title":"Doc Blocks"},"short_doc_block":{"anyOf":[{"$ref":"#/components/schemas/ModelDocBlock"},{"type":"null"}]},"schemas":{"items":{"$ref":"#/components/schemas/SchemaVariant"},"type":"array","title":"Schemas"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","default":{}},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"max_output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Output Tokens"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"deprecated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deprecated"},"quantization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantization"},"mmlu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mmlu"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"import_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Time"},"is_partner":{"type":"boolean","title":"Is Partner","default":false},"is_custom_deployable":{"type":"boolean","title":"Is Custom Deployable","default":false},"mf_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Name"},"mf_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mf Title"}},"type":"object","required":["model_name","type","tags","reported_type","version","featured","public","curl_inv","cmdline_inv","txt_docs","out_example","out_docs","pricing","schemas"],"title":"ModelInfoOut"},"ModelMetaIn":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"short model description in plain text"},"github_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Github Url","description":"source code project link (empty to delete)"},"paper_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paper Url","description":"paper/research link (empty to delete)"},"license_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"License Url","description":"usage license link (empty to delete)"},"readme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Readme","description":"markdown flavored model readme"},"cover_img_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover Img Url","description":"dataurl or regular url to cover image (empty to delete)"},"reported_type":{"anyOf":[{"$ref":"#/components/schemas/HFTasksE"},{"type":"null"}],"description":"model type"}},"additionalProperties":false,"type":"object","title":"ModelMetaIn"},"ModelMetadata":{"properties":{"description":{"type":"string","title":"Description"},"context_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Length"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"pricing":{"additionalProperties":{"type":"number"},"type":"object","title":"Pricing"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"default_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Width"},"default_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Height"},"default_iterations":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Iterations"}},"type":"object","required":["description","pricing","tags"],"title":"ModelMetadata","description":"Per-model metadata exposed by ``/v1/openai/models``.\n\nPricing key names are surface-specific:\n\n- chat / vlm: {\"input_tokens\", \"output_tokens\", \"cache_read_tokens\"} ($/1M tokens)\n- embed: {\"input_tokens\"} ($/1M tokens)\n- image-gen: {\"per_image_unit\"} ($/image at default geometry)\n- video-gen: {\"output_seconds\"} ($/sec generated)\n- tts: {\"input_characters\"} ($/1M input chars)\n- stt: {\"input_seconds\"} ($/sec input audio)\n\n``tags`` always carries the surface short alias (e.g. ``'chat'``,\n``'image-gen'``) and, for chat models, any of ``'vision'``,\n``'prompt_cache'``, ``'reasoning_effort'``, ``'reasoning'``."},"ModelNameSuggestionOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"A model name that is currently free to claim (prefixed in username/model-name format)."}},"type":"object","required":["model_name"],"title":"ModelNameSuggestionOut"},"ModelOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Name","examples":["microsoft/resnet-50"]},"type":{"type":"string","title":"Type","description":"raw type of the model","examples":["image-classification"]},"reported_type":{"type":"string","title":"Reported Type","description":"reported type of the model","examples":["text-generation"]},"description":{"type":"string","title":"Description","description":"description of the model","default":"","examples":["ResNet-50 is a convolutional neural network that is trained on more than a million images from the ImageNet database. It is a 50-layer deep neural network."]},"cover_img_url":{"type":"string","title":"Cover Img Url","description":"cover image link","default":""},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"list of tags"},"pricing":{"anyOf":[{"$ref":"#/components/schemas/ModelPricingTime"},{"$ref":"#/components/schemas/ModelPricingTokens"},{"$ref":"#/components/schemas/ModelPricingInputLength"},{"$ref":"#/components/schemas/ModelPricingInputTokens"},{"$ref":"#/components/schemas/ModelPricingUptime"},{"$ref":"#/components/schemas/ModelPricingInputCharacterLength"},{"$ref":"#/components/schemas/ModelPricingImageUnits"},{"$ref":"#/components/schemas/ModelPricingOutputLength"},{"$ref":"#/components/schemas/ModelPricingFrameUnits"}],"title":"Pricing","description":"The pricing type and cost for this model"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","description":"The maximum context size of this model, if applicable"},"replaced_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replaced By"},"deprecated":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deprecated"},"quantization":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantization"},"mmlu":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mmlu"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"create_ts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Create Ts"},"private":{"type":"integer","title":"Private","default":0},"is_partner":{"type":"boolean","title":"Is Partner","default":false}},"type":"object","required":["model_name","type","reported_type","pricing"],"title":"ModelOut"},"ModelPricingFrameUnits":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"frame_units"},"cents_per_frame_unit":{"type":"number","title":"Cents Per Frame Unit"}},"type":"object","required":["cents_per_frame_unit"],"title":"ModelPricingFrameUnits"},"ModelPricingImageUnits":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"image_units"},"cents_per_image_unit":{"type":"number","title":"Cents Per Image Unit"},"default_width":{"type":"integer","title":"Default Width"},"default_height":{"type":"integer","title":"Default Height"},"default_iterations":{"type":"integer","title":"Default Iterations"},"default_price_cents":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Default Price Cents"},"usage_from_cost":{"type":"boolean","title":"Usage From Cost"}},"type":"object","required":["cents_per_image_unit","default_width","default_height","default_iterations","usage_from_cost"],"title":"ModelPricingImageUnits"},"ModelPricingInputCharacterLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_character_length"},"cents_per_input_chars":{"type":"number","title":"Cents Per Input Chars"}},"type":"object","required":["cents_per_input_chars"],"title":"ModelPricingInputCharacterLength"},"ModelPricingInputLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_length"},"cents_per_input_sec":{"type":"number","title":"Cents Per Input Sec"}},"type":"object","required":["cents_per_input_sec"],"title":"ModelPricingInputLength"},"ModelPricingInputTokens":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"input_tokens"},"cents_per_input_token":{"type":"number","title":"Cents Per Input Token"}},"type":"object","required":["cents_per_input_token"],"title":"ModelPricingInputTokens"},"ModelPricingOutputLength":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"output_length"},"cents_per_output_sec":{"type":"number","title":"Cents Per Output Sec"}},"type":"object","required":["cents_per_output_sec"],"title":"ModelPricingOutputLength"},"ModelPricingTime":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"time"},"cents_per_sec":{"type":"number","title":"Cents Per Sec"}},"type":"object","required":["cents_per_sec"],"title":"ModelPricingTime"},"ModelPricingTokens":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"tokens"},"cents_per_input_token":{"type":"number","title":"Cents Per Input Token"},"cents_per_output_token":{"type":"number","title":"Cents Per Output Token"},"rate_per_input_token_cached":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Input Token Cached"},"rate_per_input_token_cache_write":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Input Token Cache Write"}},"type":"object","required":["cents_per_input_token","cents_per_output_token"],"title":"ModelPricingTokens"},"ModelPricingUptime":{"properties":{"short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short","description":"Short description of the pricing, ideal for cards and headers","examples":["$0.15 / second"]},"full":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full","description":"Full description of the pricing, perfect for details","examples":["$0.15 / second for 1080P, $0.10 / second for 720P"]},"table":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table","description":"Could be used to generate pricing tables","examples":[{"columns":["resolution","$ cost per second"],"rows":[["780P","$0.10"],["1080P","$0.15"]]}]},"type":{"type":"string","title":"Type","default":"uptime"},"cents_per_sec":{"type":"number","title":"Cents Per Sec"}},"type":"object","required":["cents_per_sec"],"title":"ModelPricingUptime"},"ModelProvider":{"type":"string","enum":["huggingface","deepinfra","cnt"],"title":"ModelProvider"},"ModelPublicityIn":{"properties":{"public":{"type":"boolean","title":"Public","description":"whether to make the model public of private"}},"type":"object","required":["public"],"title":"ModelPublicityIn"},"ModelVersionOut":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Model Name","examples":["microsoft/resnet-50"]},"version":{"type":"string","title":"Version","description":"Version identifier","examples":["06dbf5f73be4b5eca79e137e00c4825f467cd5b172c64b6c9255dc4b5a25a03a"]},"uploaded_at":{"type":"string","title":"Uploaded At","description":"Upload time","examples":["2023-01-19T21:52:03.626241+00:00"]}},"type":"object","required":["model_name","version","uploaded_at"],"title":"ModelVersionOut"},"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. 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":["meta-llama/Llama-2-70b-chat-hf"]},"messages":{"items":{"anyOf":[{"$ref":"#/components/schemas/ChatCompletionToolMessage"},{"$ref":"#/components/schemas/ChatCompletionAssistantMessage"},{"$ref":"#/components/schemas/ChatCompletionUserMessage"},{"$ref":"#/components/schemas/ChatCompletionSystemMessage"}]},"type":"array","title":"Messages","description":"conversation messages: (user,assistant,tool)*,user including one system message anywhere"},"stream":{"type":"boolean","title":"Stream","description":"whether to stream the output via SSE or return the full response","default":false},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic","default":1.0},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.","default":1.0},"min_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min P","description":"Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.","default":0.0},"top_k":{"type":"integer","exclusiveMaximum":1000.0,"minimum":0.0,"title":"Top K","description":"Sample from the best k (number of) tokens. 0 means off","default":0},"max_tokens":{"anyOf":[{"type":"integer","maximum":10000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"The maximum number of tokens to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller."},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"up to 16 sequences where the API will stop generating further tokens"},"stop_token_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Stop Token Ids","description":"Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments."},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"number of sequences to return","default":1},"presence_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Presence Penalty","description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"frequency_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Frequency Penalty","description":"Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/ChatTools"},"type":"array"},{"type":"null"}],"title":"Tools","description":"A list of tools the model may call. Currently, only functions are supported as a tool."},"tool_choice":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ChatTools"},{"type":"null"}],"title":"Tool Choice","description":"Controls which (if any) function is called by the model. none means the model will not call a function and instead generates a message. auto means the model can pick between generating a message or calling a function. required means the model must call a function. defined tool means the model must call that specific tool. none is the default when no functions are present. auto is the default if functions are present."},"response_format":{"anyOf":[{"$ref":"#/components/schemas/TextResponseFormat"},{"$ref":"#/components/schemas/JsonObjectResponseFormat"},{"$ref":"#/components/schemas/JsonSchemaResponseFormat"},{"$ref":"#/components/schemas/RegexResponseFormat"},{"type":"null"}],"title":"Response Format","description":"The format of the response. Currently, only json is supported."},"repetition_penalty":{"type":"number","maximum":5.0,"minimum":0.01,"title":"Repetition Penalty","description":"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)","default":1},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers."},"seed":{"anyOf":[{"type":"integer","exclusiveMaximum":1.8446744073709552e+19,"minimum":-9.223372036854776e+18},{"type":"null"}],"title":"Seed","description":"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed."},"logprobs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Logprobs","description":"Whether to return log probabilities of the output tokens or not.If true, returns the log probabilities of each output token returned in the `content` of `message`."},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/StreamOptions"},{"type":"null"}],"description":"streaming options"},"reasoning_effort":{"anyOf":[{"type":"string","enum":["low","medium","high","xhigh","none"]},{"type":"null"}],"title":"Reasoning Effort","description":"Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, high, and xhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Setting to none disables reasoning entirely if the model supports."},"reasoning":{"anyOf":[{"$ref":"#/components/schemas/ChatReasoningSettings"},{"type":"null"}],"description":"Reasoning configuration."},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key","description":"A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key."},"chat_template_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Chat Template Kwargs","description":"Chat template kwargs."},"continue_final_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Continue Final Message","description":"If set, the final assistant message is used as a prefix for the model to continue generating from, rather than starting a new turn. Only applicable when the last message in the conversation is an assistant message."}},"type":"object","required":["model","messages"],"title":"OpenAIChatCompletionsIn"},"OpenAICompletionsIn":{"properties":{"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":["meta-llama/Llama-2-70b-chat-hf"]},"prompt":{"anyOf":[{"type":"string"},{"items":{"type":"integer"},"type":"array"}],"title":"Prompt","description":"input prompt - a single string is currently supported"},"max_tokens":{"anyOf":[{"type":"integer","maximum":10000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Tokens","description":"The maximum number of tokens to generate in the completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length.If explicitly set to None it will be the model's max context length minus input length or 16384, whichever is smaller."},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","description":"What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic","default":1.0},"top_p":{"type":"number","maximum":1.0,"exclusiveMinimum":0.0,"title":"Top P","description":"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.","default":1.0},"min_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min P","description":"Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.","default":0.0},"top_k":{"type":"integer","exclusiveMaximum":1000.0,"minimum":0.0,"title":"Top K","description":"Sample from the best k (number of) tokens. 0 means off","default":0},"n":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"N","description":"number of sequences to return","default":1},"stream":{"type":"boolean","title":"Stream","description":"whether to stream the output via SSE or return the full response","default":false},"logprobs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logprobs","description":"return top tokens and their log-probabilities"},"echo":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Echo","description":"return prompt as part of the respons"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop","description":"up to 16 sequences where the API will stop generating further tokens"},"presence_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Presence Penalty","description":"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"frequency_penalty":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Frequency Penalty","description":"Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics.","default":0},"response_format":{"anyOf":[{"$ref":"#/components/schemas/TextResponseFormat"},{"$ref":"#/components/schemas/JsonObjectResponseFormat"},{"$ref":"#/components/schemas/JsonSchemaResponseFormat"},{"$ref":"#/components/schemas/RegexResponseFormat"},{"type":"null"}],"title":"Response Format","description":"The format of the response. Currently, only json is supported."},"repetition_penalty":{"type":"number","maximum":5.0,"minimum":0.01,"title":"Repetition Penalty","description":"Alternative penalty for repetition, but multiplicative instead of additive (> 1 penalize, < 1 encourage)","default":1},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User","description":"A unique identifier representing your end-user, which can help monitor and detect abuse. Avoid sending us any identifying information. We recommend hashing user identifiers."},"seed":{"anyOf":[{"type":"integer","exclusiveMaximum":1.8446744073709552e+19,"minimum":-9.223372036854776e+18},{"type":"null"}],"title":"Seed","description":"Seed for random number generator. If not provided, a random seed is used. Determinism is not guaranteed."},"stream_options":{"anyOf":[{"$ref":"#/components/schemas/StreamOptions"},{"type":"null"}],"description":"streaming options"},"stop_token_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Stop Token Ids","description":"Up to 16 token IDs where the API will stop generating further tokens. Merged with the model's built-in stop tokens. Intended for private deployments."},"return_tokens_as_token_ids":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Return Tokens As Token Ids","description":"return tokens as token ids"},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key","description":"A key to identify prompt cache for reuse across requests. If provided, the prompt will be cached and can be reused in subsequent requests with the same key."},"data":{"anyOf":[{"$ref":"#/components/schemas/CompletionMultiModalData"},{"type":"null"}],"description":"Optional multi-modal data to pass alongside the prompt. Only supported for a small number of non-chat-native vision models. Images must be base64 data URIs (e.g. 'data:image/png;base64,...')."}},"type":"object","required":["model","prompt"],"title":"OpenAICompletionsIn"},"OpenAIEmbeddingsIn":{"properties":{"service_tier":{"anyOf":[{"$ref":"#/components/schemas/ServiceTier"},{"type":"null"}],"description":"The service tier used for processing the request. When set to 'priority', the request will be processed with higher priority (only applies to models that support it)."},"model":{"type":"string","title":"Model","description":"model name","examples":["thenlper/gte-large"]},"input":{"anyOf":[{"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"}},"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. When set to 'priority', the request will be processed with higher priority (only applies to models that support it)."},"model":{"type":"string","title":"Model","description":"model name","examples":["deepinfra/tts"]},"input":{"type":"string","title":"Input","description":"Text to convert to speech","examples":["I'm beginnin' to feel like a Rap God, Rap God\nAll my people from the front to the back nod, back nod\nNow, who thinks their arms are long enough to slap box, slap box?\nThey said I rap like a robot, so call me Rap-bot"]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice","description":"Preset voices to use for the speech."},"response_format":{"$ref":"#/components/schemas/TtsResponseFormat","description":"response format for the speech"},"speed":{"type":"number","maximum":4.0,"minimum":0.25,"title":"Speed","description":"speed of the speech","default":1.0},"extra_body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Body","description":"Extra body parameters for the model."}},"type":"object","required":["model","input"],"title":"OpenAITextToSpeechIn"},"OpenClawAgentTypeMetaOut":{"properties":{"pretty_name":{"type":"string","title":"Pretty Name","description":"Human-readable display name for the framework"},"version":{"type":"string","title":"Version","description":"Agent framework version"},"has_dashboard":{"type":"boolean","title":"Has Dashboard","description":"Whether instances of this framework expose a dashboard via the nginx proxy. False -> SSH-only; the UI should hide the dashboard launch affordance and surface the SSH connection string instead."},"plans":{"items":{"$ref":"#/components/schemas/OpenClawPlanOut"},"type":"array","title":"Plans","description":"Plans available for this agent type"}},"type":"object","required":["pretty_name","version","has_dashboard","plans"],"title":"OpenClawAgentTypeMetaOut"},"OpenClawBackupOut":{"properties":{"snapshot_name":{"type":"string","title":"Snapshot Name"},"size_in_gb":{"type":"integer","title":"Size In Gb"},"state":{"type":"string","title":"State"},"created_at_unix":{"type":"integer","title":"Created At Unix"}},"type":"object","required":["snapshot_name","size_in_gb","state","created_at_unix"],"title":"OpenClawBackupOut"},"OpenClawCatalogOut":{"additionalProperties":{"$ref":"#/components/schemas/OpenClawAgentTypeMetaOut"},"type":"object","title":"OpenClawCatalogOut","description":"Per-agent-type catalog: keyed by agent_type_id, each entry carries the\ncurrent version and the plans available for that type."},"OpenClawCreateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Instance name"},"agent_type_id":{"type":"string","title":"Agent Type Id","description":"Agent type identifier","default":"openclaw"},"plan_id":{"type":"string","title":"Plan Id","description":"Plan identifier","default":"standard"}},"type":"object","required":["name"],"title":"OpenClawCreateIn"},"OpenClawCreateOut":{"properties":{"instance_id":{"type":"string","title":"Instance Id","description":"Instance ID"}},"type":"object","required":["instance_id"],"title":"OpenClawCreateOut"},"OpenClawInstanceOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"state":{"$ref":"#/components/schemas/AgentInstanceState"},"start_ts":{"type":"integer","title":"Start Ts"},"state_ts":{"type":"integer","title":"State Ts"},"stop_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stop Ts"},"price_per_hour":{"type":"number","title":"Price Per Hour"},"region":{"type":"string","title":"Region"},"last_backup_ts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Backup Ts"},"ssh_port":{"type":"integer","title":"Ssh Port"},"fail_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fail Reason"},"public_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Ip"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"agent_type":{"type":"string","title":"Agent Type"},"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":"OpenClawInstanceOut"},"OpenClawLaunchTokenOut":{"properties":{"dashboard_url":{"type":"string","title":"Dashboard Url","description":"Single-use URL that opens the dashboard. Short TTL; mint right before navigating."}},"type":"object","required":["dashboard_url"],"title":"OpenClawLaunchTokenOut"},"OpenClawPlanOut":{"properties":{"id":{"type":"string","title":"Id","description":"Plan identifier"},"vcpu":{"type":"integer","title":"Vcpu","description":"Number of vCPUs"},"ram_gb":{"type":"integer","title":"Ram Gb","description":"RAM in GB"},"price_per_hour":{"type":"number","title":"Price Per Hour","description":"Price in USD per hour"},"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":"OpenClawPlanOut"},"OpenClawUpdateIn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name","description":"Instance name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"OpenClawUpdateIn"},"OpenRouterDatacenter":{"properties":{"country_code":{"type":"string","title":"Country Code","description":"ISO 3166 Alpha-2 country code"}},"type":"object","required":["country_code"],"title":"OpenRouterDatacenter"},"OpenRouterModelData":{"properties":{"id":{"type":"string","title":"Id","description":"Model identifier used when calling the provider API"},"hugging_face_id":{"type":"string","title":"Hugging Face Id","description":"HuggingFace model ID if available","default":""},"name":{"type":"string","title":"Name","description":"Human-readable model name"},"created":{"type":"integer","title":"Created","description":"Unix timestamp of model creation"},"input_modalities":{"items":{"type":"string"},"type":"array","title":"Input Modalities","description":"Supported input modalities"},"output_modalities":{"items":{"type":"string"},"type":"array","title":"Output Modalities","description":"Supported output modalities"},"quantization":{"type":"string","title":"Quantization","description":"Model quantization type"},"context_length":{"type":"integer","title":"Context Length","description":"Maximum context length"},"max_output_length":{"type":"integer","title":"Max Output Length","description":"Maximum output length"},"pricing":{"$ref":"#/components/schemas/OpenRouterPricing","description":"Pricing information"},"supported_sampling_parameters":{"items":{"type":"string"},"type":"array","title":"Supported Sampling Parameters","description":"Supported sampling parameters"},"supported_features":{"items":{"type":"string"},"type":"array","title":"Supported Features","description":"Supported features"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Model description"},"deprecation_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deprecation Date","description":"ISO 8601 date YYYY-MM-DD for deprecation"},"openrouter":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Openrouter","description":"OpenRouter specific data"},"datacenters":{"items":{"$ref":"#/components/schemas/OpenRouterDatacenter"},"type":"array","title":"Datacenters","description":"Available datacenters"}},"type":"object","required":["id","name","created","input_modalities","output_modalities","quantization","context_length","max_output_length","pricing","supported_sampling_parameters","supported_features","datacenters"],"title":"OpenRouterModelData"},"OpenRouterModelsOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OpenRouterModelData"},"type":"array","title":"Data","description":"List of available models"}},"type":"object","required":["data"],"title":"OpenRouterModelsOut"},"OpenRouterPricing":{"properties":{"prompt":{"type":"string","title":"Prompt","description":"Pricing per 1 token for input"},"completion":{"type":"string","title":"Completion","description":"Pricing per 1 token for output"},"input_cache_read":{"type":"string","title":"Input Cache Read","description":"Pricing per 1 token for cache reads","default":"0"}},"type":"object","required":["prompt","completion"],"title":"OpenRouterPricing"},"PresetConfigOut":{"properties":{"id":{"type":"string","title":"Id","description":"Preset id."},"source":{"type":"string","title":"Source","description":"Source of this config (e.g. deepinfra).","default":"deepinfra"},"engine":{"type":"string","title":"Engine","description":"Inference engine the preset was tuned for.","default":"vllm"},"gpu_configs":{"items":{"type":"string"},"type":"array","title":"Gpu Configs","description":"Allowed Nx hardware configs."},"standard_args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Preset engine tuning knobs."},"label":{"type":"string","title":"Label","description":"Short display name for the preset (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"},"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"},"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"}},"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"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Chat Completions","description":"OpenAI and Anthropic-compatible chat completion endpoints for LLMs."},{"name":"Text Completions","description":"OpenAI-compatible text completion endpoints."},{"name":"Embeddings","description":"Generate text embeddings for search and RAG."},{"name":"Image Generation","description":"Generate, edit, and create variations of images."},{"name":"Audio","description":"OpenAI-compatible speech synthesis, transcription, and translation."},{"name":"Text to Speech","description":"ElevenLabs-compatible TTS endpoints and voice management."},{"name":"Inference","description":"Native DeepInfra inference API for models and deployments."},{"name":"Dedicated Models","description":"Deploy and manage private model instances with autoscaling."},{"name":"GPU Rentals","description":"Rent dedicated GPU containers."},{"name":"Models","description":"Browse, search, and manage AI models."},{"name":"Files & Batches","description":"File uploads and batch processing."},{"name":"LoRA Adapters","description":"Create, manage, and query LoRA adapter models."},{"name":"Agents","description":"Manage agent-framework instances (OpenClaw and friends)."},{"name":"Account","description":"User profile, team management, and rate limits."},{"name":"Authentication","description":"API tokens, SSH keys, scoped JWTs, and login flows."},{"name":"Billing","description":"Payment methods, usage tracking, and billing."},{"name":"Logs & Metrics","description":"Query inference logs, deployment logs, and usage metrics."},{"name":"Utilities","description":"Feedback submission and CLI version."}]} \ No newline at end of file